Class: LiteRGSS::Sprite

Inherits:
Object
  • Object
show all
Defined in:
LiteRGSS.rb

Overview

Note:

Sprites cannot be saved, loaded from file nor cloned in the memory

Class that describe a sprite shown on the screen or inside a viewport

Direct Known Subclasses

ShaderedSprite

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(viewport = nil) ⇒ Sprite

Create a new Sprite

Parameters:

  • viewport (Viewport, nil) (defaults to: nil)

    the viewport in which the sprite is shown

Instance Attribute Details

#angleNumeric

The rotation of the sprite in degree

Returns:

  • (Numeric)

#bitmapBitmap?

Bitmap shown by the sprite

Returns:

#heightInteger (readonly)

Return the sprite height

Returns:

  • (Integer)

#mirrorBoolean

If the sprite texture is mirrored

Returns:

  • (Boolean)

#opacityNumeric

The opacity of the sprite

Returns:

  • (Numeric)

#oxNumeric

The origin x of the bitmap's pixels

Returns:

  • (Numeric)

#oyNumeric

The origin y of the bitmap's pixels

Returns:

  • (Numeric)

#src_rectRect

Surface of the sprite's bitmap show on the screen

Returns:

#viewportLiteRGSS::Viewport? (readonly)

The sprite viewport

Returns:

#visibleBoolean

If the sprite is shown or not

Returns:

  • (Boolean)

#widthInteger (readonly)

Return the sprite width

Returns:

  • (Integer)

#xNumeric

X coordinate of the sprite

Returns:

  • (Numeric)

#yNumeric

Y coordinate of the sprite

Returns:

  • (Numeric)

#zNumeric

The z Coordinate of the sprite (unused by LiteRGSS)

Returns:

  • (Numeric)

#zoom_xNumeric

The zoom scale in width of the sprite

Returns:

  • (Numeric)

#zoom_yNumeric

The zoom scale in height of the sprite

Returns:

  • (Numeric)

Instance Method Details

#__index__Integer

Return the sprite index to know if it has been created before an other sprite (in the same viewport)

Returns:

  • (Integer)

#disposeself

Dispose the sprite

Returns:

  • (self)

#disposed?Boolean

Indicate if the sprite is disposed or not

Returns:

  • (Boolean)

#set_origin(ox, oy) ⇒ self

Define the origine of the sprite (inside the bitmap)

Parameters:

  • ox (Numeric)
  • oy (Numeric)

Returns:

  • (self)

#set_position(x, y) ⇒ self

Define the position of the sprite

Parameters:

  • x (Numeric)
  • y (Numeric)

Returns:

  • (self)

#zoom=(zoom)

Define the zoom of the sprite when shown on screen

Parameters:

  • zoom (Numeric)

    the zoom factor