📜
RGSS Reference Manual
  • RGSS Reference Manual
  • RGSS Specifications
  • Ruby Syntax
    • Syntax and Expressions
    • Variables and Constants
    • Literals
    • Operator Expressions
    • Control Structures
    • Method Calls
    • Class and Method Definitions
  • Standard Library
    • Built-in Functions
    • Built-in Variables
    • Built-in Classes
      • Object
        • Array
        • Exception
        • FalseClass
        • Hash
        • IO
          • File
        • MatchData
        • Module
          • Class
        • NilClass
        • Numeric
          • Integer
            • Bignum
            • Fixnum
          • Float
        • Range
        • Proc
        • Regexp
        • String
        • Symbol
        • Time
        • TrueClass
    • Built-in Modules
      • Comparable
      • Enumerable
      • Errno
      • FileTest
      • GC
      • Kernel
      • Marshal
      • Math
    • Built-in Exception Classes
  • Game Library
    • RGSS Built-in Functions
    • RGSS Built-in Classes
      • Bitmap
      • Color
      • Font
      • Plane
      • Rect
      • Sprite
      • Table
      • Tilemap
      • Tone
      • Viewport
      • Window
      • RGSSError
      • RPG::Sprite
      • RPG::Weather
    • RGSS Built-in Modules
      • Audio
      • Graphics
      • Input
      • RPG
      • RPG::Cache
    • RPGXP Data Structures
      • RPG::Map
      • RPG::MapInfo
      • RPG::Event
      • RPG::Event::Page
      • RPG::Event::Page::Condition
      • RPG::Event::Page::Graphic
      • RPG::EventCommand
      • RPG::MoveRoute
      • RPG::MoveCommand
      • RPG::Actor
      • RPG::Class
      • RPG::Class::Learning
      • RPG::Skill
      • RPG::Item
      • RPG::Weapon
      • RPG::Armor
      • RPG::Enemy
      • RPG::Enemy::Action
      • RPG::Troop
      • RPG::Troop::Member
      • RPG::Troop::Page
      • RPG::Troop::Page::Condition
      • RPG::State
      • RPG::Animation
      • RPG::Animation::Frame
      • RPG::Animation::Timing
      • RPG::Tileset
      • RPG::CommonEvent
      • RPG::System
      • RPG::System::Words
      • RPG::System::TestBattler
      • RPG::AudioFile
  • Appendix
    • Regular Expression
    • sprintf Format
Powered by GitBook
On this page
  • Superclass
  • Class Method
  • Sprite.new([viewport])
  • Methods
  • dispose
  • disposed?
  • viewport
  • flash(color, duration)
  • update
  • Properties
  • bitmap
  • src_rect
  • visible
  • x
  • y
  • z
  • ox
  • oy
  • zoom_x
  • zoom_y
  • angle
  • mirror
  • bush_depth
  • opacity
  • blend_type
  • color
  • tone
  1. Game Library
  2. RGSS Built-in Classes

Sprite

The sprite class. Sprites are the basic concept used to display characters, etc. on the game screen.

PreviousRectNextTable

Last updated 1 year ago

Superclass

Class Method

Sprite.new([viewport])

Creates a new Sprite object. Specifies a Viewport () when necessary.

Methods

dispose

Frees the sprite. If the sprite has already been freed, does nothing.

disposed?

Returns TRUE if the sprite has been freed.

viewport

Gets the Viewport () specified when the tilemap was created.

flash(color, duration)

Begins flashing the sprite. duration specifies the number of frames the flash will last.

If color is set to nil, the sprite will disappear while flashing.

update

Refreshes the sprite 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

bitmap

src_rect

visible

The sprite's visibility. If TRUE, the sprite is visible.

x

The sprite's X-coordinate.

y

The sprite's Y-coordinate.

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 sprite's starting point.

oy

The Y-coordinate of the sprite's starting point.

zoom_x

The sprite's X-axis zoom level. 1.0 denotes actual pixel size.

zoom_y

The sprite's Y-axis zoom level. 1.0 denotes actual pixel size.

angle

The sprite's angle of rotation. Specifies up to 360 degrees of counterclockwise rotation. However, drawing a rotated sprite is time-consuming, so avoid overuse.

mirror

Flag denoting the sprite has been flipped horizontally. If TRUE, the sprite will be drawn flipped.

bush_depth

The Bush depth for that sprite. This is a pixel value denoting how much of the sprite's lower portion will be displayed as semitransparent. A simple way to convey a sense of a character's feet being obscured by foliage and the like.

opacity

The sprite's opacity (0-255). Values out of range are automatically corrected.

blend_type

The sprite's blending mode (0: normal, 1: addition, 2: subtraction).

color

tone

Refers to the bitmap () used for the sprite's starting point.

The box () taken from a bitmap.

The color () to be blended with the sprite. Alpha values are used in the blending ratio.

Handled separately from the color blended into a effect. However, the color with the higher alpha value when displayed will have the higher priority when blended.

The sprite's color tone ().

Object
Viewport
Viewport
Bitmap
Rect
Color
flash
Tone