MCPcopy Create free account
hub / github.com/defold/defold / LuaSetFlipbookPlaybackRate

Function LuaSetFlipbookPlaybackRate

engine/gui/src/gui_script.cpp:4621–4637  ·  view source on GitHub ↗

sets the playback rate of the flipbook animation on a node * This is only useful nodes with flipbook animations. Sets the playback rate of the flipbook animation on a node. Must be positive. * * @name gui.set_flipbook_playback_rate * @param node [type:node] node to set the cursor for * @param playback_rate [type:number] playback rate */

Source from the content-addressed store, hash-verified

4619 * @param playback_rate [type:number] playback rate
4620 */
4621 static int LuaSetFlipbookPlaybackRate(lua_State* L)
4622 {
4623 DM_LUA_STACK_CHECK(L, 0);
4624
4625 HNode node;
4626 Scene* scene = GuiScriptInstance_Check(L);
4627 LuaCheckNodeInternal(L, 1, &node);
4628
4629 if(dmGui::GetNodeIsBone(scene, node))
4630 {
4631 return DM_LUA_ERROR("cannot set playback rate for bone");
4632 }
4633
4634 SetNodeFlipbookPlaybackRate(scene, node, luaL_checknumber(L, 2));
4635
4636 return 0;
4637 }
4638
4639 /*# creates a new particle fx node
4640 * Dynamically create a particle fx node.

Callers

nothing calls this directly

Calls 5

GuiScriptInstance_CheckFunction · 0.85
LuaCheckNodeInternalFunction · 0.85
luaL_checknumberFunction · 0.85
GetNodeIsBoneFunction · 0.70

Tested by

no test coverage detected