cancels a single animation or all animations * * If one or more animations of the specified node is currently running (started by gui.animate ), they will immediately be canceled. * * @name gui.cancel_animations * @param node [type:node] node that should have its animation canceled * @param [property] [type:nil|string|constant] optional property for which
| 1631 | * ``` |
| 1632 | */ |
| 1633 | static int LuaCancelAnimations(lua_State* L) |
| 1634 | { |
| 1635 | int top = lua_gettop(L); |
| 1636 | (void) top; |
| 1637 | |
| 1638 | Scene* scene = GuiScriptInstance_Check(L); |
| 1639 | |
| 1640 | HNode hnode; |
| 1641 | InternalNode* node = LuaCheckNodeInternal(L, 1, &hnode); |
| 1642 | (void) node; |
| 1643 | |
| 1644 | dmhash_t property_hash = 0; |
| 1645 | if (top >= 2 && !lua_isnil(L, 2)) |
| 1646 | { |
| 1647 | property_hash = dmScript::CheckHashOrString(L, 2); |
| 1648 | } |
| 1649 | |
| 1650 | if (property_hash != 0 && !dmGui::HasPropertyHash(scene, hnode, property_hash)) { |
| 1651 | luaL_error(L, "property '%s' not found", dmHashReverseSafe64(property_hash)); |
| 1652 | } |
| 1653 | |
| 1654 | CancelAnimationHash(scene, hnode, property_hash); |
| 1655 | |
| 1656 | assert(top== lua_gettop(L)); |
| 1657 | return 0; |
| 1658 | } |
| 1659 | |
| 1660 | void LuaPushNode(lua_State* L, dmGui::HScene scene, dmGui::HNode node) |
| 1661 | { |
nothing calls this directly
no test coverage detected