Class holding common attribute names (for WML) and common implementation (in C++) for shapes placed with the 4 attributes x, y, w and h. More...
#include <canvas_private.hpp>
Classes | |
struct | calculated_rects |
Where to draw, calculated from the x,y,w,h formulas but with different reference points used as the origin of the co-ordinate system. More... | |
Protected Member Functions | |
rect_bounded_shape (const config &cfg) | |
Constructor. More... | |
calculated_rects | calculate_rects (const SDL_Rect &view_bounds, wfl::map_formula_callable &variables) const |
Private Attributes | |
typed_formula< int > | x_ |
The x coordinate of the rectangle. More... | |
typed_formula< int > | y_ |
The y coordinate of the rectangle. More... | |
typed_formula< int > | w_ |
The width of the rectangle. More... | |
typed_formula< int > | h_ |
The height of the rectangle. More... | |
Additional Inherited Members | |
![]() | |
shape (const config &cfg) | |
virtual | ~shape () |
virtual void | draw (surface &canvas, SDL_Renderer *renderer, const SDL_Rect &view_bounds, wfl::map_formula_callable &variables)=0 |
Draws the canvas. More... | |
bool | immutable () const |
Class holding common attribute names (for WML) and common implementation (in C++) for shapes placed with the 4 attributes x, y, w and h.
Keys:
Key | Type | Default | Description |
---|---|---|---|
x | f_unsigned | 0 | The x coordinate of the top left corner. |
y | f_unsigned | 0 | The y coordinate of the top left corner. |
w | f_unsigned | 0 | The width of the rectangle. |
h | f_unsigned | 0 | The height of the rectangle. |
Definition at line 118 of file canvas_private.hpp.
|
explicitprotected |
Constructor.
cfg | The config object to define the rectangle. |
Definition at line 254 of file canvas.cpp.
|
protected |
Definition at line 263 of file canvas.cpp.
References sdl::create_rect(), DBG_GUI_D, h, h_, w, w_, x_, and y_.
Referenced by gui2::rectangle_shape::draw(), gui2::round_rectangle_shape::draw(), and gui2::text_shape::draw().
|
private |
The height of the rectangle.
Definition at line 163 of file canvas_private.hpp.
Referenced by calculate_rects().
|
private |
The width of the rectangle.
Definition at line 162 of file canvas_private.hpp.
Referenced by calculate_rects().
|
private |
The x coordinate of the rectangle.
Definition at line 160 of file canvas_private.hpp.
Referenced by calculate_rects().
|
private |
The y coordinate of the rectangle.
Definition at line 161 of file canvas_private.hpp.
Referenced by calculate_rects().