Squirrel/Script Types/VectorScreen
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
+ | VectorScreens originate in the top-left corner. This code makes a VectorScreen that starts 10 pixels down and 10 pixels to the right. | ||
− | + | <code lang="squirrel"> | |
− | + | local screen = VectorSceen( 10, 10 ); | |
+ | </code> | ||
+ | |||
+ | This code makes a VectorScreen about 10 pixels down and 20 pixels from the right. | ||
+ | <code lang="squirrel"> | ||
+ | local screen = VectorScreen( ScreenWidth - 20, 10 ); | ||
+ | </code> | ||
+ | This code creates a VectorScreen approximately in the middle of the screen. | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | local screen = VectorScreen( ScreenWidth / 2, ScreenHeight / 2 ); | |
</code> | </code> | ||
Latest revision as of 12:30, 2 August 2011
The VectorScreen type is a 2-dimensional vector used to indicate positions on screen. The origin is at the top-left corner of the screen.
[edit] Constructor
VectorScreen( int x, int y )
[edit] Values
- x - The X coordinate of the vector
- y - The Y coordinate of the vector
[edit] Example
VectorScreens originate in the top-left corner. This code makes a VectorScreen that starts 10 pixels down and 10 pixels to the right.
local screen = VectorSceen( 10, 10 );
This code makes a VectorScreen about 10 pixels down and 20 pixels from the right.
local screen = VectorScreen( ScreenWidth - 20, 10 );
This code creates a VectorScreen approximately in the middle of the screen.
local screen = VectorScreen( ScreenWidth / 2, ScreenHeight / 2 );
[edit] Types
- Colour
- ScreenSize
- Vector
- Vector2D
- VectorScreen