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

Function AnimateNodeHash

engine/gui/src/gui.cpp:4000–4043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3998 }
3999
4000 void AnimateNodeHash(HScene scene,
4001 HNode node,
4002 dmhash_t property,
4003 const Vector4& to,
4004 dmEasing::Curve easing,
4005 Playback playback,
4006 float duration,
4007 float delay,
4008 AnimationComplete animation_complete,
4009 void* userdata1,
4010 void* userdata2)
4011 {
4012 uint16_t version = (uint16_t) (node >> 16);
4013 uint16_t index = node & 0xffff;
4014 InternalNode* n = &scene->m_Nodes[index];
4015 assert(n->m_Version == version);
4016
4017 PropDesc* pd = GetPropertyDesc(property);
4018 if (pd)
4019 {
4020 float* base_value = (float*)&n->m_Node.m_Properties[pd->m_Property];
4021
4022 if (pd->m_Component == 0xff)
4023 {
4024 dmEasing::Curve no_callback_easing = easing;
4025 no_callback_easing.release_callback = 0;
4026 for (int j = 0; j < 3; ++j)
4027 {
4028 AnimateComponent(scene, node, &base_value[j], to.getElem(j), no_callback_easing, playback, duration, delay, 1.0f, 0, 0, 0);
4029 }
4030
4031 // Only run callback for the lastcomponent
4032 AnimateComponent(scene, node, &base_value[3], to.getElem(3), easing, playback, duration, delay, 1.0f, animation_complete, userdata1, userdata2);
4033 }
4034 else
4035 {
4036 AnimateComponent(scene, node, &base_value[pd->m_Component], to.getElem(pd->m_Component), easing, playback, duration, delay, 1.0f, animation_complete, userdata1, userdata2);
4037 }
4038 }
4039 else
4040 {
4041 dmLogError("property '%s' not found", dmHashReverseSafe64(property));
4042 }
4043 }
4044
4045 dmhash_t GetPropertyHash(Property property)
4046 {

Callers 5

LuaAnimateFunction · 0.70
TEST_FFunction · 0.50
MyAnimationCompleteFunction · 0.50
MyPingPongComplete1Function · 0.50
MyPingPongComplete2Function · 0.50

Calls 5

GetPropertyDescFunction · 0.85
AnimateComponentFunction · 0.85
dmHashReverseSafe64Function · 0.85
assertFunction · 0.50
getElemMethod · 0.45

Tested by 4

TEST_FFunction · 0.40
MyAnimationCompleteFunction · 0.40
MyPingPongComplete1Function · 0.40
MyPingPongComplete2Function · 0.40