Sprite

Inherits: Node2D < CanvasItem < Node < Object

Category: Core

Brief Description

General purpose Sprite node.

Signals

  • frame_changed ( )

Emitted when the frame changes.

  • texture_changed ( )

Emitted when the texture changes.

Member Variables

  • bool centered - If true texture is centered. Default value: true.
  • bool flip_h - If true texture is flipped horizontally. Default value: false.
  • bool flip_v - If true texture is flipped vertically. Default value: false.
  • int frame - Current frame to display from sprite sheet. vframes or hframes must be greater than 1.
  • int hframes - The number of collumns in the sprite sheet.
  • Texture normal_map - The normal map gives depth to the Sprite.
  • Vector2 offset - The texture’s drawing offset.
  • bool region_enabled - If true texture is cut from a larger atlas texture. See region_rect. Default value: false.
  • bool region_filter_clip - If true the outermost pixels get blurred out.
  • Rect2 region_rect - The region of the atlas texture to display. region_enabled must be true.
  • Texture texture - Texture object to draw.
  • int vframes - The number of rows in the sprite sheet.

Description

A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.