static DrawingSurface* Room.GetDrawingSurfaceForBackground(optional int backgroundNumber)
Gets a drawing surface for a room background, which allows you to directly draw
onto the room's background image. You can provide a background frame number if you
want to modify a specific frame; otherwise, the current background's surface will be returned.
After calling this method, use the various DrawingSurface functions to modify the
background, then call Release on the surface when you are finished.
Any changes you make will only last until the player leaves the room, at
which point they will be lost. If you need to make long-lasting changes, you
can either use this method in the Player Enters Room event, or consider using
an alternate background frame for the changed image.
NOTE: Drawing onto the room background can be slow, especially when using the Direct3D
driver. Do not use this command in repeatedly_execute; make sure you only use this command
when absolutely necessary.
Example:
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawingColor = 14;
surface.DrawLine(0, 0, 50, 50);
surface.Release();
draws a yellow diagonal line across the top-left of the current room background,
then releases the image.
See Also: DrawingSurface.DrawLine,
DrawingSurface.Release
|