> For the complete documentation index, see [llms.txt](https://enls.gitbook.io/rgss-reference-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enls.gitbook.io/rgss-reference-manual/game-library/rgss-built-in-classes/sprite.md).

# Sprite

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

## Superclass

* [Object](/rgss-reference-manual/standard-library/built-in-classes/object.md)

## Class Method

### Sprite.new(\[*viewport*])

Creates a new Sprite object. Specifies a Viewport ([Viewport](/rgss-reference-manual/game-library/rgss-built-in-classes/viewport.md)) 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 ([Viewport](/rgss-reference-manual/game-library/rgss-built-in-classes/viewport.md)) 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

Refers to the bitmap ([Bitmap](/rgss-reference-manual/game-library/rgss-built-in-classes/bitmap.md)) used for the sprite's starting point.

### src\_rect

The box ([Rect](/rgss-reference-manual/game-library/rgss-built-in-classes/rect.md)) taken from a bitmap.

### 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

The color ([Color](/rgss-reference-manual/game-library/rgss-built-in-classes/color.md)) to be blended with the sprite. Alpha values are used in the blending ratio.

Handled separately from the color blended into a [flash](#flash-color-duration) effect. However, the color with the higher alpha value when displayed will have the higher priority when blended.

### tone

The sprite's color tone ([Tone](/rgss-reference-manual/game-library/rgss-built-in-classes/tone.md)).
