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

Function LuaGetFlipbookPlaybackRate

engine/gui/src/gui_script.cpp:4596–4612  ·  view source on GitHub ↗

gets the playback rate of the flipbook animation on a node * This is only useful nodes with flipbook animations. Gets the playback rate of the flipbook animation on a node. * * @name gui.get_flipbook_playback_rate * @param node [type:node] node to set the cursor for * @return rate [type:number] playback rate */

Source from the content-addressed store, hash-verified

4594 * @return rate [type:number] playback rate
4595 */
4596 static int LuaGetFlipbookPlaybackRate(lua_State* L)
4597 {
4598 DM_LUA_STACK_CHECK(L, 1);
4599
4600 Scene* scene = GuiScriptInstance_Check(L);
4601 HNode node;
4602 LuaCheckNodeInternal(L, 1, &node);
4603
4604 if (dmGui::GetNodeIsBone(scene, node))
4605 {
4606 return DM_LUA_ERROR("cannot get playback rate for bone");
4607 }
4608
4609 lua_pushnumber(L, dmGui::GetNodeFlipbookPlaybackRate(scene, node));
4610
4611 return 1;
4612 }
4613
4614 /*# sets the playback rate of the flipbook animation on a node
4615 * This is only useful nodes with flipbook animations. Sets the playback rate of the flipbook animation on a node. Must be positive.

Callers

nothing calls this directly

Calls 5

GuiScriptInstance_CheckFunction · 0.85
LuaCheckNodeInternalFunction · 0.85
lua_pushnumberFunction · 0.85
GetNodeIsBoneFunction · 0.70

Tested by

no test coverage detected