Legacy:SetClippingRectangle: Difference between revisions
Jump to navigation
Jump to search
Created initial page |
added navbox |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
Sets the drawing bounds of the screen to the width and height at the (x, y) location. | |||
==Usage== | ==Usage== | ||
| Line 38: | Line 36: | ||
* [[API:IsKeyPressed|IsKeyPressed]]() | * [[API:IsKeyPressed|IsKeyPressed]]() | ||
* [[API:Rectangle|Rectangle]](x, y, width, height) | * [[API:Rectangle|Rectangle]](x, y, width, height) | ||
{{API:Video/navbox}} | |||
Latest revision as of 21:07, 4 June 2013
Sets the drawing bounds of the screen to the width and height at the (x, y) location.
Usage
SetClippingRectangle(x, y, width, height);
- x: the X coordinate of the clipping rectangle.
- y: the Y coordinate of the clipping rectangle.
- width: the width of the clipping rectangle.
- height: the height of the clipping rectangle.
Notes
Set it to 0, 0, GetScreenWidth(), GetScreenHeight() to reset it.
Examples
Clipping out a portion of a rectangle.
// restricts drawing to just this 50x50 square, at location (50, 50).
SetClippingRectangle(50, 50, 50, 50);
while (!IsKeyPressed(KEY_ESCAPE)) {
Rectangle(0, 0, GetScreenWidth(), GetScreenHeight());
FlipScreen();
}
See also
- GetClippingRectangle()
- IsKeyPressed()
- Rectangle(x, y, width, height)