Skip to content

Latest commit

 

History

History
91 lines (48 loc) · 2.6 KB

class_sprite.rst

File metadata and controls

91 lines (48 loc) · 2.6 KB

Sprite

Inherits: Node2D<class_node2d> < CanvasItem<class_canvasitem> < Node<class_node> < Object<class_object>

Category: Core

Brief Description

General purpose Sprite node.

Signals

  • frame_changed ( )

Emitted when the frame<class_Sprite_frame> changes.

  • texture_changed ( )

Emitted when the texture<class_Sprite_texture> changes.

Member Variables

  • bool<class_bool> centered - If true texture is centered. Default value: true.
  • bool<class_bool> flip_h - If true texture is flipped horizontally. Default value: false.
  • bool<class_bool> flip_v - If true texture is flipped vertically. Default value: false.
  • int<class_int> frame - Current frame to display from sprite sheet. vframes<class_Sprite_vframes> or hframes<class_Sprite_hframes> must be greater than 1.
  • int<class_int> hframes - The number of columns in the sprite sheet.
  • Texture<class_texture> normal_map - The normal map gives depth to the Sprite.
  • Vector2<class_vector2> offset - The texture's drawing offset.
  • bool<class_bool> region_enabled - If true texture is cut from a larger atlas texture. See region_rect. Default value: false.
  • bool<class_bool> region_filter_clip - If true the outermost pixels get blurred out.
  • Rect2<class_rect2> region_rect - The region of the atlas texture to display. region_enabled<class_Sprite_region_enabled> must be true.
  • Texture<class_texture> texture - Texture<class_texture> object to draw.
  • int<class_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.