gre.animation add step

gre.animation_add_step(id, data)

Add a step to a created animation. The id must be from a call to gre.animation_create. The data parameter defines the animation step values.

Parameters: id The animation id data A table of animation step values which can include: key: The data key for the animation step to act upon rate: The animation rate string: [linear | easein | easeout | easeinout | bounce] duration: The length of the step (ms) offset: The offset from animation start where this step begins (ms) from: The value to start the animation at, if not specified the value is the current value of "key" to: The end point for the animation delta: The delta for the end of the animation from the start point. If both "to" and "delta" are given then the "to" value is used. Example:

function create_animation(mapargs)
    local data = {}

    -- slide the x position 400 pixels over 2000 ms and auto-destroy
    -- it on completion
    id  = gre.animation_create(60, 1)
    data["rate"] = "linear"
    data["duration"] = 2000
    data["offset"] = 0
    data["delta"] = 400
    data["key"] = "mylayer.mycontrol.grd_x"
    gre.animation_add_step(id, data)
end
Was this article helpful?
0 out of 0 found this helpful