Module: LiteRGSS::Graphics

Defined in:
LiteRGSS.rb

Overview

Graphics module manages the frame and window display

Constant Summary

StoppedError =

Error triggered when you use a Graphic function without starting the window display ( `Graphics.start` )

StandardError.new
ClosedWindowError =

Error triggered when the user closes the Window

StandardError.new

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.brightnessInteger

Return the screen brightness (between 0 and 255)

Returns:

  • (Integer)

.frame_countInteger

Return the number of frames shown on the screen

Returns:

  • (Integer)

.heightInteger (readonly)

Return the game screen height

Returns:

  • (Integer)

.shaderLiteRGSS::Shader?

Returns shader used on the whole screen

Returns:

.widthInteger (readonly)

Return the game screen width

Returns:

  • (Integer)

Class Method Details

.freeze

Freeze the Graphics by showing the current frame on top of each sprite (triggers a Graphics.update to take the current frame)

.list_resolutionsArray<Array(width, height)>

Return an array containing the possible 32 bits fullscreen resolutions

Returns:

.reload_stackself

Reload the sprite stack (z_order processing)

Returns:

  • (self)

.resize_screen(width, height)

Note:

If you change LiteRGSS::Config::ScreenScale, the actual window size will be (width * ScreenScale) x (height * ScreenScale)

Resize the screen (inGameScreen)

Parameters:

  • width (Integer)

    new width of the window (will affect LiteRGSS::Config::ScreenWidth)

  • height (Integer)

    new height of the window (will affect LiteRGSS::Config::ScreenHeight)

Returns:

  • self

.snap_to_bitmapBitmap

Take a snapshot of the frame before the last Graphics.update

Returns:

.start

Start the Graphic display : show a window according to the LiteRGSS::Config constants and unlock the Graphics functions

.stop

Stop the Grahics display : closes the window and lock the Graphics functions

.transition(nb_frame = 8, bitmap = nil)

Show a transition between the frozen Graphics and the new Graphic state

Parameters:

  • nb_frame (Integer) (defaults to: 8)

    the number of frames the transition lasts

  • bitmap (LiteRGSS::Bitmap) (defaults to: nil)

    the bitmap to use to perform the transition

.update

Show the current frame to the screen and catch every SFML Events that LiteRGSS reads (Input)

.update_no_inputself

Update only the sprite display (does not increase the frame_count as well)

Returns:

  • (self)

.update_only_inputself

Update only the Inputs (no graphic processing but perform message processing)

Returns:

  • (self)