![]() |
Chesto 0.9
A declarative and element-based library for creating GUIs on homebrew'd consoles
|


Public Member Functions | |
| bool | process (InputEvents *event) |
| process any input that is received for this element More... | |
| void | render (Element *parent) |
| display the current state of the display More... | |
| void | update () |
| int | mainLoop () |
| void | initMusic () |
| void | startMusic () |
| void | setScreenResolution (int width, int height) |
| void | requestQuit () |
Public Member Functions inherited from Chesto::Element | |
| virtual bool | process (InputEvents *event) |
| process any input that is received for this element More... | |
| virtual void | render (Element *parent) |
| display the current state of the display More... | |
| bool | onTouchDown (InputEvents *event) |
| bool | onTouchDrag (InputEvents *event) |
| bool | onTouchUp (InputEvents *event) |
| void | hide () |
| void | unhide () |
| void | renderBackground (bool fill=true) |
| void | addNode (std::unique_ptr< Element > node) |
| void | remove (Element *element) |
| void | removeAll () |
| void | position (int x, int y) |
| position the element More... | |
| void | recalcPosition (Element *parent) |
| float | getEffectiveScale () const |
| CST_Rect | getBounds () |
| CST_Renderer * | getRenderer () |
| Element * | setPosition (int x, int y) |
| Element * | setAction (std::function< void()> func) |
| Element * | setAbsolute (bool isAbs) |
| template<typename T , typename... Args> | |
| T * | createNode (Args &&... args) |
| Element * | constrain (int flags, int padding=0) |
| Element * | constrainToTarget (Element *target, int flags, int padding=0) |
| Element * | animate (int durationIn, std::function< void(float)> onStep, std::function< void()> onFinish) |
| Element * | moveToFront () |
| Element * | setTouchable (bool touchable) |
| void | screenshot (std::string path) |
| Take a screenshot of this element and its children, and save it to the given path. More... | |
Static Public Member Functions | |
| static void | pushScreen (std::unique_ptr< Screen > screen) |
| static void | popScreen () |
| static Screen * | topScreen () |
| static void | clearScreens () |
| static bool | hasScreens () |
| static void | deferAction (std::function< void()> action) |
| static void | processDeferredActions () |
Public Attributes | |
| bool | canUseSelectToExit = false |
| int | lastFrameTime = 99 |
| SDL_Event | needsRender |
| std::unique_ptr< InputEvents > | events |
| std::function< void()> | windowResizeCallback = NULL |
| Mix_Music * | music = NULL |
Public Attributes inherited from Chesto::Element | |
| std::function< void()> | action = NULL |
| the action to call (from binded callback) on touch or button selection https://stackoverflow.com/questions/14189440/c-class-member-callback-simple-examples More... | |
| std::function< void(InputEvents *event)> | actionWithEvents = NULL |
| std::vector< std::unique_ptr< Element, std::function< void(Element *)> > > | elements |
| visible GUI child elements of this element More... | |
| float | scale = 1.0f |
| bool | touchable = false |
| whether or not this element can be touched (highlights bounds) More... | |
| bool | dragging = false |
| whether or not this element is currently being dragged More... | |
| bool | needsRedraw = false |
| whether or not this element needs the screen redrawn next time it's processed More... | |
| int | futureRedrawCounter = 0 |
| whether this element needs a redraw for the next X redraws (decreases each time) (0 is no redraws) More... | |
| int | lastMouseY = 0 |
| the last Y, X coordinate of the mouse (from a drag probably) More... | |
| int | lastMouseX = 0 |
| bool | hasBackground = false |
| rgb | backgroundColor = {0, 0, 0} |
| int | backgroundOpacity = 0xff |
| bool | isAbsolute = false |
| Element * | parent = nullptr |
| the parent element (reference only, not owned) More... | |
| bool | hidden = false |
| whether this element should skip rendering or not More... | |
| bool | isProtected = false |
| int | elasticCounter = 0 |
| how much time is left in an elastic-type flick/scroll set by the last distance traveled in a scroll, and counts down every frame More... | |
| int | width = 0 |
| width and height of this element (must be manually set, isn't usually calculated (but is in some cases, like text or images)) More... | |
| int | height = 0 |
| int | x = 0 |
| int | y = 0 |
| int | xAbs = 0 |
| int | yAbs = 0 |
| double | angle = 0 |
| rotation angle in degrees More... | |
| int | cornerRadius = 0 |
| int | tag = 0 |
| std::vector< std::unique_ptr< Constraint > > | constraints |
| std::vector< std::unique_ptr< Animation > > | animations |
| bool | useColorMask = false |
| whether or not to overlay a color mask on top of this element More... | |
| CST_Color | maskColor = {0,0,0,0} |
| The color to overlay on top. More... | |
Static Public Attributes | |
| static CST_Renderer * | renderer = NULL |
| static CST_Window * | window = NULL |
| static RootDisplay * | mainDisplay = NULL |
| static std::vector< std::unique_ptr< Screen > > | screenStack |
| static std::vector< std::function< void()> > | deferredActions |
| static bool | isProcessingEvents = false |
| static int | screenWidth = 1280 |
| static int | screenHeight = 720 |
| static float | dpiScale = 1.0f |
| static float | globalScale = 1.0f |
| static bool | idleCursorPulsing = false |
| static bool | isDebug = false |
Additional Inherited Members | |
Public Types inherited from Chesto::Element | |
| typedef Element | super |
Protected Member Functions inherited from Chesto::Element | |
| void | addStackMember (Element *element) |
Definition at line 24 of file RootDisplay.hpp.
| Chesto::RootDisplay::RootDisplay | ( | ) |
Definition at line 47 of file RootDisplay.cpp.
|
virtual |
Definition at line 210 of file RootDisplay.cpp.
|
static |
Definition at line 167 of file RootDisplay.cpp.
|
static |
Definition at line 181 of file RootDisplay.cpp.
|
static |
Definition at line 205 of file RootDisplay.cpp.
| void Chesto::RootDisplay::initMusic | ( | ) |
Definition at line 97 of file RootDisplay.cpp.
| int Chesto::RootDisplay::mainLoop | ( | ) |
Definition at line 298 of file RootDisplay.cpp.
|
static |
Definition at line 148 of file RootDisplay.cpp.
|
virtual |
process any input that is received for this element
Reimplemented from Chesto::Element.
Definition at line 227 of file RootDisplay.cpp.
References Chesto::Element::process().
|
static |
Definition at line 187 of file RootDisplay.cpp.
|
static |
Definition at line 139 of file RootDisplay.cpp.
|
virtual |
display the current state of the display
Reimplemented from Chesto::Element.
Definition at line 244 of file RootDisplay.cpp.
References Chesto::Element::parent, and Chesto::Element::render().
| void Chesto::RootDisplay::requestQuit | ( | ) |
Definition at line 282 of file RootDisplay.cpp.
| void Chesto::RootDisplay::setScreenResolution | ( | int | width, |
| int | height | ||
| ) |
Definition at line 117 of file RootDisplay.cpp.
| void Chesto::RootDisplay::startMusic | ( | ) |
Definition at line 112 of file RootDisplay.cpp.
|
static |
Definition at line 200 of file RootDisplay.cpp.
| void Chesto::RootDisplay::update | ( | ) |
Definition at line 266 of file RootDisplay.cpp.
| bool Chesto::RootDisplay::canUseSelectToExit = false |
Definition at line 82 of file RootDisplay.hpp.
|
static |
Definition at line 62 of file RootDisplay.hpp.
|
static |
Definition at line 71 of file RootDisplay.hpp.
| std::unique_ptr<InputEvents> Chesto::RootDisplay::events |
Definition at line 88 of file RootDisplay.hpp.
|
static |
Definition at line 74 of file RootDisplay.hpp.
|
static |
Definition at line 79 of file RootDisplay.hpp.
|
static |
Definition at line 81 of file RootDisplay.hpp.
|
static |
Definition at line 64 of file RootDisplay.hpp.
| int Chesto::RootDisplay::lastFrameTime = 99 |
Definition at line 84 of file RootDisplay.hpp.
|
static |
Definition at line 43 of file RootDisplay.hpp.
| Mix_Music* Chesto::RootDisplay::music = NULL |
Definition at line 95 of file RootDisplay.hpp.
| SDL_Event Chesto::RootDisplay::needsRender |
Definition at line 85 of file RootDisplay.hpp.
|
static |
Definition at line 41 of file RootDisplay.hpp.
|
static |
Definition at line 68 of file RootDisplay.hpp.
|
static |
Definition at line 59 of file RootDisplay.hpp.
|
static |
Definition at line 67 of file RootDisplay.hpp.
|
static |
Definition at line 42 of file RootDisplay.hpp.
| std::function<void()> Chesto::RootDisplay::windowResizeCallback = NULL |
Definition at line 90 of file RootDisplay.hpp.