37 pCaller->OnEndAnimation();
58 g.
DrawText(mText,
"Click to animate", mRECT);
69 void OnEndAnimation()
override
71 mStartRect = mEndRect;
72 IControl::OnEndAnimation();
76 IRECT mStartRect, mEndRect, mDrawnRect;
77 IColor mStartColor, mEndColor, mDrawnColor;
Easing functions, based on Warren Moore's AHEasing library https://github.com/warrenm/AHEasing See he...
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
double GetAnimationProgress() const
Get the progress in a control's animation, in the range 0-1.
IControl * SetTooltip(const char *str)
Set a tooltip for the control.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
IControl * SetActionFunction(IActionFunction actionFunc)
Set an Action Function for this control.
void SetAnimation(IAnimationFunction func)
Set the animation function.
The lowest level base class of an IGraphics context.
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Control to test animation.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
Used to manage color data, independent of draw class/platform.
static IColor LinearInterpolateBetween(const IColor &start, const IColor &dest, float progress)
Helper function to linear interpolate between two IColors.
static IColor GetRandomColor(bool randomAlpha=false)
Get a random IColor.
Used to manage mouse modifiers i.e.
Used to manage a rectangular area, independent of draw class/platform.
static IRECT LinearInterpolateBetween(const IRECT &start, const IRECT &dest, float progress)
Get a rectangle that is a linear interpolation between start and dest
IRECT GetRandomSubRect() const