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

Function LuaSetFlipbookCursor

engine/gui/src/gui_script.cpp:4571–4587  ·  view source on GitHub ↗

sets the normalized cursor of the animation on a node with flipbook animation * This is only useful nodes with flipbook animations. The cursor is normalized. * * @name gui.set_flipbook_cursor * @param node [type:node] node to set the cursor for * @param cursor [type:number] cursor value */

Source from the content-addressed store, hash-verified

4569 * @param cursor [type:number] cursor value
4570 */
4571 static int LuaSetFlipbookCursor(lua_State* L)
4572 {
4573 DM_LUA_STACK_CHECK(L, 0);
4574
4575 Scene* scene = GuiScriptInstance_Check(L);
4576 HNode node;
4577 LuaCheckNodeInternal(L, 1, &node);
4578
4579 if (dmGui::GetNodeIsBone(scene, node))
4580 {
4581 return DM_LUA_ERROR("cannot set cursor for bone");
4582 }
4583
4584 dmGui::SetNodeFlipbookCursor(scene, node, luaL_checknumber(L, 2));
4585
4586 return 0;
4587 }
4588
4589 /*# gets the playback rate of the flipbook animation on a node
4590 * This is only useful nodes with flipbook animations. Gets the playback rate of the flipbook animation on a node.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected