Language

Map.addAnimation


Map.addAnimation(string id, int depth, int x, int y, int frame_width, float delay, string texture, int type, bool custom_texture)

Description

Add an animation to the map.
Animation file must be on ONE single row.

Parameters

id
Unique ID of the entity.
depth
The depth of the entity. Between 0 and 20.
x
X coordinate.
y
Y coordinate.
frame_width
How much width is a frame in the animation.
delay
Time to wait between each frame in second.
texture
The name of the texture file.
type
The type. 0 = Solid. 1 = Artwork. 2 = Kill on touch. 3 = Solid from top.
custom_texture
Set to true if the texture is shipped with your map (sprites/ directory).

Examples

Add an animation

  1. function onReset()
  2.     Map.addAnimation("my_animation", 12, 500, 750, 3, 0.2, "npc.png", 1, true)
  3. end