34 const char* words[] = {
"there",
"are many" ,
"possible",
"ways",
"to display text",
"here" };
37 g.
DrawText(mText, words[mStringIndex], mRECT);
54 int size = (std::rand() % 200) + 12;
55 int align = (std::rand() % 3);
56 int valign = (std::rand() % 3);
57 int type = (std::rand() % 2);
58 mStringIndex = (std::rand() % 6);
60 const char* types[] = {
"Roboto-Regular",
"Montserrat-LightItalic" };
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
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.
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.
void CreateTextEntry(IControl &control, const IText &text, const IRECT &bounds, const char *str="", int valIdx=0)
Create a text entry box.
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 drawing text.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnMouseDblClick(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse double click event on this control.
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.
IText is used to manage font and text/text entry style for a piece of text on the UI,...