Difference between revisions of "Legacy:GetScreenHeight"
From Spherical
(created from http://web.archive.org/web/20120504055855/http://www.spheredev.org/wiki/GetScreenHeight) |
(filled) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
GetScreenHeight() returns the value in pixels of the current screen/game window height. | GetScreenHeight() returns the value in pixels of the current screen/game window height. | ||
Line 6: | Line 4: | ||
==Usage== | ==Usage== | ||
− | {{Usage|returns=integer | + | {{Usage|returns=integer|func=GetScreenHeight}} |
− | + | ==Examples== | |
− | + | <syntaxhighlight> | |
− | + | Abort("This game takes up " + GetScreenHeight() + " vertical pixels of your screen.\n") | |
+ | </syntaxhighlight> | ||
+ | Aborts Sphere with the message of how high the horizontal resolution of the game is. | ||
− | = | + | <syntaxhighlight> |
− | ( | + | var white = CreateColor(255,255,255); |
+ | Rectangle(0, 0, 25, GetScreenHeight(), white); | ||
+ | </syntaxhighlight> | ||
+ | This draws a white rectangle over the left part of the screen, in full height and 25 pixels width. | ||
==Notes== | ==Notes== | ||
− | + | If you don't configure your game, the screen height is 240 by default. | |
==See also== | ==See also== | ||
− | * | + | * [[API:GetScreenWidth|GetScreenWidth]]() |
− | * | + | * [[API:Abort|Abort]]() |
− | * | + | * [[API:CreateColor|CreateColor]]() |
− | * | + | * [[API:Rectangle|Rectangle]]() |
{{API:Video/navbox}} | {{API:Video/navbox}} |
Latest revision as of 21:23, 4 June 2013
GetScreenHeight() returns the value in pixels of the current screen/game window height.
Contents
Usage
integer GetScreenHeight();
Examples
Abort("This game takes up " + GetScreenHeight() + " vertical pixels of your screen.\n")
Aborts Sphere with the message of how high the horizontal resolution of the game is.
var white = CreateColor(255,255,255);
Rectangle(0, 0, 25, GetScreenHeight(), white);
This draws a white rectangle over the left part of the screen, in full height and 25 pixels width.
Notes
If you don't configure your game, the screen height is 240 by default.
See also
- GetScreenWidth()
- Abort()
- CreateColor()
- Rectangle()