How to lower the resolution of the GUI

Wainggan

Member
So my game is scaled up 4 times its normal size... and the GUI follows along, but the GUI is too high-res compared to the game behind it.
I searched through the manual, but I can't find anything helpful.
How could I fix this?
 

Wainggan

Member
Would display_set_gui_size be what you're looking for?
I tried using it, but it doesn't lower the resolution of the gui layer.

I should clarify... The gui layer is correctly sized. If I were to draw a sprite to it, the pixels of the sprite would be the correct size.
When I draw something on it with draw_circle, it is placed on the correct pixels, it has the right width, it just that it draws the circle at a too high resolution.
 

NightFrost

Member
Ah, that's a feature of the draw command. Line draw acts the same way. The commands draw at display resolution. I've heard the explanation as to why at one point, but I can't recall it now. It had something to do with how GPUs handle this stuff or something like that.
 
You can't, but if you use an orthographic projection, then you can set the size you want (and you don't necessarily need the GUI event as a result).
 
draw_circle is quite an expensive command, it's drawing 24 triangles (unless you changed it with draw_set_circle_precision() ), if you have space on your texture page, you could just have say a 100x100 white circle, and scale it (with image interpolation disabled). This reduces the triangles to 2. You can change its colour with image_blend in draw_sprite_ext (although if this isn't static, this will be slow also as each tint you use is cached). But it would at least fit the pixel resolution of your game
 
I was so sure I was right that I tested it, and it turns out I'm not lol.

These are the results for drawing 1000 circles per step, for 10 seconds (precision set once per step).
1620382634792.png

So the results are:
1. draw a circle at precision 4 (0.17ms)
2. draw a circle at precision 24 (0.26ms) (Default setting)
3. draw a circle using a sprite (0.28ms)
4. draw a circle at precision 40 (0.30ms)

A circle at precision 4 is fastest but, a circle with 4 points is just a square at 45 degrees so, not particularly useful.

So in conclusion, although slower and uses up your texture page, drawing a circle using a sprite might achieve the effect you're looking for (depending how large the circle you need is). But I correct myself, it sadly won't be faster.
 
Last edited:
Top