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

Method notifyFrameStart

Tools/EditorFramework/MessageBoxFadeControl.cpp:30–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30 void MessageBoxFadeControl::notifyFrameStart(float _time)
31 {
32 const float coef = 1;
33
34 bool visible = MessageBoxManager::getInstance().hasAny();
35
36 if (visible)
37 {
38 if (!mMainWidget->getVisible())
39 {
40 mMainWidget->setVisible(true);
41 mMainWidget->setAlpha(0);
42 }
43 else
44 {
45 float alpha = mMainWidget->getAlpha();
46 if (alpha < mMaxAlpha)
47 {
48 alpha += _time * coef;
49 if (alpha > mMaxAlpha)
50 alpha = mMaxAlpha;
51 mMainWidget->setAlpha(alpha);
52 }
53 }
54 }
55 else
56 {
57 if (mMainWidget->getVisible())
58 {
59 float alpha = mMainWidget->getAlpha();
60 alpha -= _time * coef;
61 if (alpha <= 0)
62 {
63 mMainWidget->setVisible(false);
64 }
65 else
66 {
67 mMainWidget->setAlpha(alpha);
68 }
69 }
70 }
71 }
72
73}

Callers

nothing calls this directly

Calls 5

hasAnyMethod · 0.80
getAlphaMethod · 0.80
getVisibleMethod · 0.45
setVisibleMethod · 0.45
setAlphaMethod · 0.45

Tested by

no test coverage detected