Graphics

The module that carries out graphics processing.

Module Methods

Graphics.update

Refreshes the game screen and advances time by 1 frame. This method must be called at set intervals.

loop do
  Graphics.update
  Input.update
  do_something
end
Graphics.wait(duration)

Waits for the specified number of frames. Equivalent to the following:

duration.times do
  Graphics.update
end
Graphics.fadeout(duration)

Performs a fade-out of the screen.

duration is the number of frames to spend on the fade-out.

Graphics.fadein(duration)

Performs a fade-in of the screen.

duration is the number of frames to spend on the fade-in.

Graphics.freeze

Freezes the current screen in preparation for transitions.

Screen rewrites are prohibited until the transition method is called.

Graphics.transition([duration[, filename[, vague]]])

Carries out a transition from the screen frozen by Graphics.freeze to the current screen.

duration is the number of frames the transition will last. The default is 10.

filename specifies the file name of the transition graphic. When not specified, a standard fade will be used. Also automatically searches files included in RGSS-RTP and encrypted archives. File extensions may be omitted.

vague sets the ambiguity of the borderline between the graphic's starting and ending points. The larger the value, the greater the ambiguity. The default is 40.

Graphics.snap_to_bitmap

Gets the current game screen image as a bitmap object.

This reflects the graphics that should be displayed at that point in time, without relation to the use of the freeze method.

The created bitmap must be freed when it is no longer needed.

Graphics.frame_reset

Resets the screen refresh timing. Call this method after a time-consuming process to prevent excessive frame skipping.

Graphics.width
Graphics.height

Gets the width and height of the game screen.

These are normally 544 and 416, respectively.

Graphics.resize_screen(width, height)

Changes the size of the game screen.

Specify a value up to 640 × 480 for width and height.

Graphics.play_movie(filename) (RGSS3)

Plays the movie specified by filename.

Returns process after waiting for playback to end.

Module Properties

Graphics.frame_rate

The number of times the screen is refreshed per second. The larger the value, the more CPU power is required. Normally set at 60.

Changing this property is not recommended, but it can be set anywhere from 10 to 120. Out-of-range values are automatically corrected.

Graphics.frame_count

The screen's refresh rate count. Set this property to 0 at game start and the game play time (in seconds) can be calculated by dividing this value by the frame_rate property value.

Graphics.brightness

The brightness of the screen. Takes a value from 0 to 255. The fadeout, fadein, and transition methods change this value internally, as required.