SetClipping

static void SetClipping(
int x, int y, int w, int h );

Sets the clipping region of the active rendering surface.

The parts of the objects which fall out of the clipping region will not be rendered.

This function could be used to implement split screen views or minimaps, for example.

Examples

// Set the clipping region to a 100 x 100 portion at the top-right side of the screen //
Transforms::SetClipping( SCREEN_W - 1000100100 );

// Set the clipping region to the left half of the screen //
Transforms::SetClipping00, SCREEN_W/2, SCREEN_H );


Other functions of the class Canvas
SetTo
Selects the active rendering surface
Refresh
Refresh the contents of the active rendering surface
Fill
Fills the active rendering surface with the specified color
SetClipping
Sets the clipping region of the active rendering surface
DisableClipping
Disables the clipping region
GetClippingRegion
GetClippingRegion
Width
Returns the width of the active rendering surface
Height
Returns the height of the active rendering surface
Save
Saves the contents of the surface to an image file

Advanced functions

SetPixelWriteMode
Selects which color components the rendering functions affect
GetMemoryBitmap
Returns the contents of the Canvas in a memory bitmap
Push
Pushes the active Canvas to a stack
Pop
Pops the most recently stored Canvas from the stack


Questions about SetClipping? Click here.