A scrollable element arranges all of it's children as a list. It's children are rendered and 'cut off' outside the dimensions of the scrollable object. Note that added elements will have their width changed to match the list! Also note that elements are placed directly below the previous element (in terms of y-coords)!
More...
|
| Scrollable (int x, int y, int w, int h, Padding p=Padding::Default) |
| Construct a new Scrollable object. More...
|
|
int | catchup () |
| Get amount to "catchup" by. More...
|
|
void | setCatchup (int c) |
| Set amount to "catchup" by. More...
|
|
float | dampening () |
| Get amount to decrease velocity by (pixels per second) More...
|
|
void | setDampening (float d) |
| Set amount to decrease velocity by (pixels per second) More...
|
|
bool | showScrollBar () |
| Returns if the scroll bar is being shown. More...
|
|
void | setShowScrollBar (bool b) |
| Set whether to show scroll bar. More...
|
|
void | setScrollBarColour (Colour c) |
| Set scroll bar colour. More...
|
|
bool | canScroll () |
| Check whether this element can be scrolled (by touch/drag) More...
|
|
void | setCanScroll (bool b) |
| Set whether this element can be scrolled by touching and dragging. More...
|
|
int | maxScrollPos () |
| Returns the maximum value permitted for scrollPos (i.e. the limit). More...
|
|
int | scrollPos () |
| Returns current scroll position of list (0 indicates at the top) More...
|
|
void | setScrollPos (int pos) |
| Sets scrollPos. Set to min/max if outside valid range. More...
|
|
void | addElement (Element *e) |
| Add the given element to the list. More...
|
|
bool | addElementAfter (Element *e, Element *a) |
| Adds an element to the scrollable object after the specified element. Pass nullptr to insert at the start. More...
|
|
bool | addElementBefore (Element *e, Element *b) |
| Adds an element to the scrollable object before the specified element. Pass nullptr to insert at the end (note: this is the same as addElement()) More...
|
|
bool | removeElementsAfter (Element *e) |
| Deletes any elements succeeding the given element. More...
|
|
bool | removeElementsBefore (Element *e) |
| Deletes any elements preceding the given element. More...
|
|
void | setW (int w) |
| Set width of element. More...
|
|
void | setH (int h) |
| Set height of element. More...
|
|
bool | removeElement (Element *e) |
| Attempt to delete given child element. More...
|
|
void | removeAllElements () |
| Deletes all children elements.
|
|
bool | returnElement (Element *e) |
| Attempt to remove the given child element. More...
|
|
void | returnAllElements () |
| Removes (but does not delete) all children elements.
|
|
bool | handleEvent (InputEvent *e) |
| Attempt to handle a given event. More...
|
|
void | update (unsigned int dt) |
| Update is passed time since last frame (for animations) More...
|
|
void | render () |
| Render child elements + highlights.
|
|
| ~Scrollable () |
| Delete the scrollable object.
|
|
| Container (int x=0, int y=0, int w=100, int h=100) |
| Construct a new Container object. More...
|
|
void | setActive () |
| Re-highlight/focus the focused element.
|
|
void | setInactive () |
| Removes focus from the focused element.
|
|
| Element (int x=0, int y=0, int w=100, int h=100) |
| Construct a new Element object. More...
|
|
int | x () |
| Returns x-coordinate of element. More...
|
|
int | y () |
| Returns y-coordinate of element. More...
|
|
int | w () |
| Returns width of element. More...
|
|
int | h () |
| Returns height of element. More...
|
|
virtual void | setX (int x) |
| Set x-coordinate of element. More...
|
|
virtual void | setY (int y) |
| Set y-coordinate of element. More...
|
|
virtual void | setXY (int x, int y) |
| Set co-ordinates of element. More...
|
|
virtual void | setWH (int w, int h) |
| Set size of element. More...
|
|
virtual void | setXYWH (int x, int y, int w, int h) |
| Setter size and co-ordinates of element. More...
|
|
Element * | parent () |
| Returns the parent element of this element. More...
|
|
void | setParent (Element *p) |
| Set the parent element of this element. More...
|
|
bool | isVisible () |
| Check if current element is visible on-screen. More...
|
|
bool | hidden () |
| Check if current element is hidden. More...
|
|
void | setHidden (bool b) |
| Set whether element is hidden or not. More...
|
|
bool | selected () |
| Check if current element is selected. More...
|
|
virtual void | setSelected (bool b) |
| Set whether element is selected or not. More...
|
|
bool | selectable () |
| Check if current element is selectable. More...
|
|
void | setSelectable (bool b) |
| Set whether element is selectable or not. More...
|
|
bool | touchable () |
| Check if current element is touch responsive. More...
|
|
void | setTouchable (bool b) |
| Set whether element is touch responsive or not. More...
|
|
bool | highlighted () |
| Check if current element is highlighted. More...
|
|
void | setHighlighted (bool b) |
| Set whether element is highlighted or not. More...
|
|
bool | hasHighlighted () |
| Check if current element has highlighted children element. More...
|
|
void | setHasHighlighted (bool b) |
| Set whether element has highlighted children element or not. More...
|
|
bool | hasSelectable () |
| Check if current element has selectable children element. More...
|
|
void | setHasSelectable (bool b) |
| Set whether element has selectable children element or not. More...
|
|
bool | hasSelected () |
| Check if current element has selected children element. More...
|
|
void | setHasSelected (bool b) |
| Set whether element has selected children element or not. More...
|
|
void | setFocused (Element *e) |
| Sets current element as unfocused and instead focuses a sub-element. More...
|
|
void | setFocussed (Element *e) |
| Sets current element as unfocused and instead focuses a sub-element. More...
|
|
Element * | focused () |
| Returns the currently focused element. More...
|
|
Element * | focussed () |
| Returns the currently focused element. More...
|
|
std::function< void()> | onPressFunc () |
| Returns function invoked when the element is pressed. More...
|
|
void | onPress (std::function< void()> f) |
| Sets the function to invoked when the element is pressed. More...
|
|
virtual Drawable * | renderHighlightBG () |
| Renders the highlight background. More...
|
|
virtual Drawable * | renderHighlight () |
| Renders the highlight border. More...
|
|
virtual Drawable * | renderSelection () |
| Renders the selection overlay. More...
|
|
virtual | ~Element () |
| Destroy the Element object.
|
|
A scrollable element arranges all of it's children as a list. It's children are rendered and 'cut off' outside the dimensions of the scrollable object. Note that added elements will have their width changed to match the list! Also note that elements are placed directly below the previous element (in terms of y-coords)!