MCPcopy Create free account
hub / github.com/MyGUI/mygui / rebuildAnimations

Method rebuildAnimations

Tools/ImageEditor/AnimationViewControl.cpp:91–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 void AnimationViewControl::rebuildAnimations()
92 {
93 mAnimation.setTextureName(std::string_view{});
94 mAnimation.clearFrames();
95 mCurrentFrame = 0;
96 mTime = 0;
97
98 if (mParentData != nullptr)
99 {
100 mAnimation.setTextureName(mParentData->getParent()->getPropertyValue("Texture"));
101 mAnimation.setSize(mParentData->getParent()->getPropertyValue<MyGUI::IntCoord>("Size").size());
102 mAnimation.setRate(mParentData->getPropertyValue<float>("Rate"));
103
104 for (Data::VectorData::const_iterator child = mParentData->getChilds().begin();
105 child != mParentData->getChilds().end();
106 child++)
107 {
108 size_t count = (*child)->getPropertyValue<size_t>("Count");
109 MyGUI::IntPoint point = (*child)->getPropertyValue<MyGUI::IntPoint>("Point");
110 mAnimation.addFrame(point, count);
111 }
112
113 if (!mPlay)
114 updateSelectedFrame();
115 }
116
117 mImage->setImageTexture(mAnimation.getTextureName());
118
119 if (mAnimation.getFrames().empty())
120 mImage->setImageCoord(MyGUI::IntCoord());
121 else
122 updateFrame();
123
124 mFrameInfo->setCaption(MyGUI::utility::toString(mCurrentFrame, " : ", mAnimation.getFrames().size()));
125
126 updateImageCoord();
127 }
128
129 void AnimationViewControl::notifyChangeProperty(PropertyPtr _sender)
130 {

Callers

nothing calls this directly

Calls 15

toStringFunction · 0.85
clearFramesMethod · 0.80
setRateMethod · 0.80
addFrameMethod · 0.80
setImageTextureMethod · 0.80
setImageCoordMethod · 0.80
IntCoordFunction · 0.50
setTextureNameMethod · 0.45
getParentMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected