aboutsummaryrefslogtreecommitdiff
path: root/src/gui/inc
Commit message (Collapse)AuthorAgeFilesLines
* gui: Allow elements to be hiddenXavier Del Campo Romero2022-09-231-1/+1
| | | | | | When a GUI element is hidden, no rendering or updating is done to it or its children. This can be useful to define a complex GUI tree structure that changes under specific conditions, without redefining it.
* Implement checkbox GUI elementXavier Del Campo Romero2022-09-231-0/+34
|
* Implement GUI line editXavier Del Campo Romero2022-09-201-0/+47
|
* gui: Implement gui_deinitXavier Del Campo Romero2022-09-201-0/+2
|
* Remap calls to pad/mouse/keyboard to inputXavier Del Campo Romero2022-09-201-2/+3
|
* Allow children of gui_container be resized anytimeXavier Del Campo Romero2022-07-101-1/+1
| | | | | | | | | | | | | | So far, their position inside the container was determined when initializing the interface. However, if a child were resized afterwards, the container would not adjust its elements accordingly. Moreover, the implementation for gui_container relied on hacking the children's X/Y coordinates, which could only be done once. Now, two additional members have been added to gui_common so that specific X/Y offset can be determined by the parent, additionally to the traditional rules followed by gui_coords. Despite the extra memory footprint, it now allows containers to set specific X/Y offsets for their children on every game cycle.
* Allow multiple button typesXavier Del Campo Romero2022-07-071-3/+22
|
* rounded_rect.h: fix typoXavier Del Campo Romero2022-07-071-1/+1
|
* gui/container: support spacing between GUI elementsXavier Del Campo Romero2022-07-021-1/+1
|
* gui/bar: support arbitrary x/y and widthXavier Del Campo Romero2022-07-021-3/+4
|
* gui: reuse callback dataXavier Del Campo Romero2022-07-021-5/+9
| | | | | | There is no need to allocate memory for these callbacks for each single GUI element. Instead, a single, statically-allocated instance can be shared among all GUI elements of a given type.
* gui: implement containerXavier Del Campo Romero2022-07-021-0/+34
| | | | | Containers, somewhat inspired by GtkBox, allow to packed other GUI elements into a single row or column.
* gui: allow custom add_child callbackXavier Del Campo Romero2022-07-021-0/+1
|
* gui: implement {h,v}centeredXavier Del Campo Romero2022-06-291-1/+2
|
* Revamp gui componentXavier Del Campo Romero2022-06-266-17/+207
| | | | | | | | | | | | | | | | | | | | `gui` was tighly coupled to game logic, and could not be extended for other purposes. Therefore, a generic GUI implementation, loosely inspired by well-known GUI frameworks such as GTK, is now provided, with the following properties: - Does not depend on dynamic or static memory allocation, only automatic (i.e., stack) memory allocation required. - Portable among existing implementations. - Simple to extend. - Tiny memory footprint. `gui` is now composed by GUI elements that can be chained to form a tree structure. This is useful e.g.: to calculate X/Y coordinates for a given GUI element given its parent(s). This commit also refactors the older implementation, moving game-specific logic into `player` and making use of the new component.
* Add project source codeXavier Del Campo Romero2022-03-301-0/+36