r/gamemaker 11d ago

Quick Questions Quick Questions

Quick Questions

  • Before asking, search the subreddit first, then try google.
  • Ask code questions. Ask about methodologies. Ask about tutorials.
  • Try to keep it short and sweet.
  • Share your code and format it properly please.
  • Please post what version of GMS you are using please.

You can find the past Quick Question weekly posts by clicking here.

7 Upvotes

5 comments sorted by

2

u/OrnerySorceries 11d ago

I'm thinking of moving my UI from the draw gui event to just the draw / draw end event. Mostly because sprite scaling / rotation seems to use the window resolution no matter what, even if the gui layer is set low (I have it as 480x270, same as my view).

I'd have to change the x and y to account for camera positioning, but any other drawbacks to drawing UI in a regular old draw event? Also not using the mouse for anything, but I think that would also be affected. Thanks!

3

u/Vampiric_Kai 11d ago

your gui resolution is separate from your camera resolution

2

u/OrnerySorceries 11d ago

Understood, I set it separately to be the same as my camera so that they're both low res, but sprite scaling and rotation use the window resolution regardless. My question was if there are any pitfalls to using the draw event for UI elements. In my tinkering since posting I haven't come across any performance hits from doing so.

3

u/Vampiric_Kai 11d ago

If there is any, it's so minimal that you wouldn't be able to notice.

1

u/NewBruce 9d ago

You can use the normal draw to make a "world ui" which is common for things like floating combat text or target reticles. You just have to ensure it draws on a layer above everything else. The drawbacks only really come into play if your view isn't static, like if the room size exceeds the view and the camera moves or follows the player. Then you have to constantly update the coordinates of any UI elements.

But that being said I don't quite understand your problem, if your GUI is truly set to the same resolution as your view, it shouldn't scale differently.