Viewport
The viewport class. Used when displaying sprites in one portion of the screen, with no overflow into other regions.
Superclass
Class Methods
Viewport.new(x, y, width, height)
Viewport.new(rect)
Creates a viewport object.
Methods
dispose
Frees the viewport. If the viewport has already been freed, does nothing.
disposed?
Returns TRUE if the viewport has been freed.
flash(color, duration)
Begins flashing the viewport. duration specifies the number of frames the flash will last.
If color is set to nil, the viewport will disappear while flashing.
update
Refreshes the viewport flash. As a rule, this method is called once per frame.
It is not necessary to call this method if no flash effect is needed.
Properties
rect
The box (Rect) defining the viewport.
visible
The viewport's visibility. If TRUE, the viewport is visible.
z
The viewport's Z-coordinate. The larger this value, the closer to the player the viewport will be displayed. If multiple objects share the same Z-coordinate, the more recently created object will be displayed closest to the player.
ox
The X-coordinate of the viewport's starting point. Change this value to shake the screen, etc.
oy
The Y-coordinate of the viewport's starting point. Change this value to shake the screen, etc.
color
The color (Color) to be blended with the viewport. Alpha values are used in the blending ratio.
Handled separately from the color blended into a flash effect.
tone
The viewport's color tone (Tone).
Last updated