Difference between revisions of "Rect"
From King Arthur's Gold Wiki
m |
|||
Line 1: | Line 1: | ||
+ | <onlyinclude> | ||
The recti type is used to create GUI elements among other things. There are two variances. | The recti type is used to create GUI elements among other things. There are two variances. | ||
+ | </onlyinclude> | ||
+ | |||
Method one uses a position2di and dimension2di argument. The dimension2di argument represents the width and the height; | Method one uses a position2di and dimension2di argument. The dimension2di argument represents the width and the height; | ||
Line 6: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
+ | Method two uses two position2di arguments. The first being the upper left hand corner and the second being the lower right hand corner. ( needs clarification. ) | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
recti rect (position2di(pos.x, pos.y), position2di(pos.x + 50, pos.y + 70)); | recti rect (position2di(pos.x, pos.y), position2di(pos.x + 50, pos.y + 70)); | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 05:50, 28 September 2012
The recti type is used to create GUI elements among other things. There are two variances.
Method one uses a position2di and dimension2di argument. The dimension2di argument represents the width and the height;
recti rect (position2di(pos.x, pos.y), dimension2di(50, 70));
Method two uses two position2di arguments. The first being the upper left hand corner and the second being the lower right hand corner. ( needs clarification. )
recti rect (position2di(pos.x, pos.y), position2di(pos.x + 50, pos.y + 70));