Icon

Draw_Set

Sebastian Duval

You must be logged in to obtain assets

Contact Publisher

Description

"One Function to set them all, One Function to define them, One Function to manage them all and in the draw_event bind them"

TL;DR:

draw_set('fn_arial',red,0.7,ha.m,va.m);

...instead of...

draw_set_font(fn_arial); draw_set_color(c_red); draw_set_alpha(0.7); draw_set_halign(fa_center); draw_set_valign(fa_middle);

Draw_Set() is a combination of the functions draw_set_color(), draw_set_font(), draw_set_alpha(), draw_set_halign() and draw_set_valign() with builtin color-conversion, without restrictions regarding the order or number of arguments.

There are two new functions:

1.) draw_set() is used to SET the values of above mentioned functions, including an extended input for color values. It replaces the single-use-functions and allows for shorter and cleaner code.

2.) cc(), short for ConvertColor, is used to RETURN a color value, for further usage, e.g. image_blend = cc("#FF0000").

Use draw_set() to set the values for color, font, alpha, halign and valign, all at once or one at a time, without restrictions regarding the order or number of arguments.

Multi-argument example:

draw_set('fn_arial', 0.7, $673AB7, ha.l, va.m);

Sets font to fn_arial, alpha to 0.7, color to purple, halign to left and valign to middle. Use the order of arguments you prefer.

Single-argument example:

draw_set(0.5);

Sets alpha to 50%. The function knows what to do based on the input.

Use cc() to convert and return colors provided as RGB, HEX or CONSTANT. Example of usage:

color = cc(255,0,0); or color =  cc("255,0,0"); or color =  cc($FF0000); or color = cc("FF0000"); or color = cc(red);

Usage of the predefined c_color constants is NOT supported, use red instead of c_red. Fonts must be provided as a string value to the function. Tested for following export modules: Windows, HTML5. Does NOT work with the YYG-Compiler right now!

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS1 - Version 1.0.2. Published July 10, 2016

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait

Back to Top