draw_text_transformed

Draws a string with scaling and rotation.

Syntax:

GML Code Example

draw_text_transformed(x, y, string, xscale, yscale, angle);


Argument Description
x The x coordinate of the drawn string.
y The y coordinate of the drawn string.
string The string to draw.
xscale The horizontal scale (default 1).
yscale The vertical scale(default 1).
angle The angle of the text.


Returns: N/A


Description

This function will draw text in a similar way to draw_text only now you can choose to scale the text along the horizontal or vertical axis (effectively stretching or shrinking it) and also have GameMaker: Studio draw it at an angle (where 0 is normal and every degree over 0 rotates the text anti-clockwise).


Example:

GML Code Example

draw_set_halign(fa_center);
 draw_set_valign(fa_middle);
 image_angle += 1;
 draw_text_transformed(room_width / 2, room_height / 2, "GAME OVER!", 2, 2, image_angle);
 

The above code will draw the given text in the middle of the room, spinning round and scaled to twice its original size.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here