wavelength 1.0.0
Loading...
Searching...
No Matches
hideablepanel.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/rampanimator.h"
4#include "rnd/rndanimatable.h"
5#include "rnd/rnddrawable.h"
6
15public:
17 static constexpr float kShownFrame = 240.0f;
18
28 HideablePanel(const char *pszAnim, const char *pszDrawable, bool bShown);
29
36 virtual ~HideablePanel() = default;
37
45 virtual void Show(bool bShow);
46
54 virtual void ShowNow(bool bShow);
55
65 void SetObjects(const char *pszAnim, const char *pszDrawable, bool bShown);
66
73 void Poll();
74
81 static void ClearSnap();
82
90 static void SetDeltaTime(float fDeltaTime);
91
101 static void Init();
102
109 static void Terminate();
110
117 static void PoseMaterials();
118
125 static int sSnap;
126
133 static float sDeltaTime;
134
142
149 static float sMaterialFrame;
150
151protected:
153
154private:
155 RndDrawable *mDrawable;
156};
void SetObjects(const char *pszAnim, const char *pszDrawable, bool bShown)
Find the animation and the drawable of the panel, and show or hide it at once.
static void Terminate()
Forget the animation of the two-dimensional materials.
void Poll()
Advance the slide by sDeltaTime, and show the drawable while the panel is not hidden.
static void PoseMaterials()
Pose the animation of the two-dimensional materials at its resting frame.
virtual void Show(bool bShow)
Slide the panel in or out, or move it at once while sSnap is set.
virtual ~HideablePanel()=default
Destroy the panel.
static float sDeltaTime
The time Poll() advances every panel by.
Definition hideablepanel.h:133
HideablePanel(const char *pszAnim, const char *pszDrawable, bool bShown)
Construct a panel and find its animation and drawable.
virtual void ShowNow(bool bShow)
Show or hide the panel at once.
static int sSnap
Whether Show() moves a panel at once rather than sliding it.
Definition hideablepanel.h:125
static void Init()
Find the animation of the two-dimensional materials and the frame it rests at.
RampAnimator mSlide
Definition hideablepanel.h:152
static void ClearSnap()
Clear sSnap.
static constexpr float kShownFrame
The frame of the animation at which the panel is fully shown.
Definition hideablepanel.h:17
static RndAnimatable * sMaterialAnim
The animation of the two-dimensional materials, mat_2d_EE.anim, or null.
Definition hideablepanel.h:141
static void SetDeltaTime(float fDeltaTime)
Set the time the next Poll() of every panel advances by.
static float sMaterialFrame
The frame PoseMaterials() poses sMaterialAnim at.
Definition hideablepanel.h:149
Value that moves toward a target along an interpolator, and poses an animation on the value.
Definition rampanimator.h:14
Mix-in for an object driven by a frame.
Definition rndanimatable.h:16
Mix-in for an object that draws itself and then a list of other drawables.
Definition rnddrawable.h:16