Skip to content

AnimatedFlag

Grisgram edited this page May 12, 2022 · 3 revisions

Changing the sprite at runtime

Attention! Do not simply set the sprite_index to another value at runtime! There are some calculations involved, when the sprite shall change, therefore a function exists in the object:

assign_sprite = function(new_sprite_index, new_image_index = 0)

Just call this function instead of a direct assignment to sprite_index and you're fine!

myFlagObject.assign_sprite(newsprite);

Instance Variables

The AnimatedFlag object offers a group of instance variables that define the running animation of the flag.

image

Variable Description
animation_fps how many frames shall be calculated?
intensity how many waves are on the flag
wave_speed how fast do the waves move
wave_height how strong are the waves
vertex_count if -1, then default of 10% of sprite width
render_width if -1, then image_xscale as set in room editor
render_height if -1, then image_yscale as set in room editor
Clone this wiki locally