The sprite class. Sprites are the basic concept used to display characters and other objects on the game screen.
Creates a new sprite object. Specifies a viewport (Viewport) when necessary.
Frees the sprite. If the sprite has already been freed, does nothing.
Returns TRUE if the sprite has been freed.
Begins flashing the sprite. duration specifies the number of frames flashing will last.
If color is set to nil, the sprite will disappear while flashing.
Advances the sprite flash or wave phase. As a general rule, this method is called once per frame.
It is not necessary to call this if a flash or wave is not needed.
Gets the width of the sprite. Equivalent to src_rect.width.
Gets the height of the sprite. Equivalent to src_rect.height.
Refers to the bitmap (Bitmap) used for the sprite's starting point.
The box (Rect) taken from a bitmap.
Refers to the viewport (Viewport) associated with the sprite.
The sprite's visibility. If TRUE, the sprite is visible. The default value is TRUE.
The sprite's x-coordinate.
The sprite's y-coordinate.
The sprite's z-coordinate. The larger the value, the closer to the player the sprite will be displayed.
If two sprites have the same z-coordinates, the one with the larger y-coordinate will be displayed closer to the player, and if the y-coordinates are the same, the one that was generated later will be displayed closer to the player.
The x-coordinate of the sprite's starting point.
The y-coordinate of the sprite's starting point.
The sprite's x-axis zoom level. 1.0 denotes actual pixel size.
The sprite's y-axis zoom level. 1.0 denotes actual pixel size.
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.
Defines the amplitude, frequency, speed, and phase of the wave effect. A raster scroll effect is achieved by using a sinusoidal function to draw the sprite with each line's horizontal position slightly different from the last.
wave_amp is the wave amplitude and wave_length is the wave frequency, and each is specified by a number of pixels.
wave_speed specifies the speed of the wave animation. The default is 360, and the larger the value, the faster the effect.
wave_phase specifies the phase of the top line of the sprite using an angle of up to 360 degrees. This is updated each time the update method is called. It is not necessary to use this property unless it is required for two sprites to have their wave effects synchronized.
A flag denoting the sprite has been flipped horizontally. If TRUE, the sprite will be drawn flipped. The default is false.
The bush depth and opacity of a sprite. This can be used to represent a situation such as the character's legs being hidden by bushes.
For bush_depth, the number of pixels for the bush section is specified. The default value is 0.
For bush_opacity, the opacity of the bush section from 0 to 255 is specified. Out-of-range values will be corrected automatically. The default value is 128.
The bush_opacity value will be multiplied by opacity. For example, if both opacity and bush_opacity are set to 128, it will be handled as a transparency on top of a transparency, for an actual opacity of 64.
The sprite's opacity (0-255). Out-of-range values are automatically corrected.
The sprite's blending mode (0: normal, 1: addition, 2: subtraction).
The color (Color) to be blended with the sprite. Alpha values are used in the blending ratio.
Handled separately from the color blended into a flash effect. However, the color with the higher alpha value when displayed will have the higher priority when blended.
The sprite's color tone (Tone).