By Daniel · January 3, 2009
Draws some text in the pattern of a wave with the given magnitude
// draw_text_wave(x, y, string, magnitude)
// Draws some text in the pattern of a wave with the given magnitude
var xx, l, i, c, a;
xx = argument0;
l = string_length(argument2);
draw_set_halign(fa_center);
draw_set_valign(fa_left);
for (i = 1; i <= l; i += 1) {
c = string_char_at(argument2, i);
a = i / 5; // adjustable
draw_text_transformed(xx, argument1 + argument3 * cos(a),
c, 1, 1, radtodeg(arctan(sin(a))));
xx += string_width(c) * 1.1;
}
Categories: 2D graphics, String handling
There are no comments to display.
You must be signed in to post comments.