You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple function to set most often used draw functions in one call.
Thanks to omitting arguments possibility in GM and possibility to use built-in functions as argument default value, this allows to skip arguments in middle by using comma, or put closing bracket after last one we need.
By default, it keeps current setting for each of those options.
Order of arguments was set by how often I'm using each of those functions based on my 21 years experience with GameMaker.
My most common cases are:
changing color+alpha (drawing transparent shapes as backgrounds for text; changing color and resetting alpha to 1 after such drawing)
changing color+font (and sometimes (re)setting alpha, depending what was drawn before; also useful for "inactive" text)
In case when only one param requires change, it's still better to use default GM functions.
This script comes from my personal toolbox, but I decided to share it and discuss if it would be useful after seeing draw_set_color_ext (#42) and draw_set_text_align (#43).
The text was updated successfully, but these errors were encountered:
Hmmm... I'd prefer the other two functions (draw_set_color_ext and draw_set_text_align) over this one.
A large part of that is that draw_setup doesn't really tell you what it does, and also the things it does aren't as tightly related as just color+alpha or text halign+valign on their own.
It's perfectly fine as a personal script, but as a library function I feel its naming is vague and it tries to do too many things at once. If I were to use this regularly, I would likely eventually lean towards for some full-fledged styling system or similar. ^^'
A simple function to set most often used draw functions in one call.
Thanks to omitting arguments possibility in GM and possibility to use built-in functions as argument default value, this allows to skip arguments in middle by using comma, or put closing bracket after last one we need.
By default, it keeps current setting for each of those options.
Order of arguments was set by how often I'm using each of those functions based on my 21 years experience with GameMaker.
My most common cases are:
Examples (including examples in which arguments are omitted):
In case when only one param requires change, it's still better to use default GM functions.
This script comes from my personal toolbox, but I decided to share it and discuss if it would be useful after seeing
draw_set_color_ext
(#42) anddraw_set_text_align
(#43).The text was updated successfully, but these errors were encountered: