Classes

Concepts

Libraries

advertisement »

ambientSounds »

bitser »

contentPoints »

eventBoxText »

factValidity »

frameBuffer »

officeBuildingInserter »

priorityRenderer »

randomEvents »

scaling »

spritesheetParser »

statusIcons »

test3 »

util »

Objects

registerAnimationEvents

Description

Register events tied to the animation. The event will be triggered when a specified frame is played.

Arguments

1 string name

the animation name.


Notice: Undefined offset: 2 in /var/www/vhosts/gamedevstudiogame.com/httpdocs/templates/method_view.phtml on line 12

2 table the event table.

Example

-- taken from game/developer/avatar.lua


local function playKeyboard(animObj, animObjOwner)
	animObjOwner:playKeyboardClicks()
end

local workAnimEvents = {}
	
local frames = tdas.getAnimData("work_hands")

for i = 1, #frames do -- clal :playKeyboardClicks() at the beginning of every frame in the animation

	workAnimEvents[i] = playKeyboard
end

register.animationEvents("work_hands", workAnimEvents)