General purpose Sprite node.
    public class Sprite : Node2D

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.

Inheritance Chain

Constructors

    public Sprite()

Signals

    "frame_changed" ()

Emitted when the Frame changes.

    "texture_changed" ()

Emitted when the Texture changes.

Properties

    public bool Centered { get; set; }

If true texture is centered. Default value: true.

    public bool FlipH { get; set; }

If true texture is flipped horizontally. Default value: false.

    public bool FlipV { get; set; }

If true texture is flipped vertically. Default value: false.

    public int Frame { get; set; }

Current frame to display from sprite sheet. Vframes or Hframes must be greater than 1.

    public int Hframes { get; set; }

The number of collumns in the sprite sheet.

    public Texture NormalMap { get; set; }

The normal map gives depth to the Sprite.

    public Vector2 Offset { get; set; }

The texture’s drawing offset.

    public bool RegionEnabled { get; set; }

If true texture is cut from a larger atlas texture. See region_rect. Default value: false.

    public bool RegionFilterClip { get; set; }

If true the outermost pixels get blurred out.

    public Rect2 RegionRect { get; set; }

The region of the atlas texture to display. RegionEnabled must be true.

    public Texture Texture { get; set; }

Texture object to draw.

    public int Vframes { get; set; }

The number of rows in the sprite sheet.

Methods

    public int GetFrame()

Getter for Frame

    public int GetHframes()

Getter for Hframes

    public Texture GetNormalMap()

Getter for NormalMap

    public Vector2 GetOffset()

Getter for Offset

    public Rect2 GetRegionRect()

Getter for RegionRect

    public Texture GetTexture()

Getter for Texture

    public int GetVframes()

Getter for Vframes

    public bool IsCentered()

Getter for Centered

    public bool IsFlippedH()

Getter for FlipH

    public bool IsFlippedV()

Getter for FlipV

    public bool IsRegion()

Getter for RegionEnabled

    public bool IsRegionFilterClipEnabled()

Getter for RegionFilterClip

    public void SetCentered(bool centered)

Setter for Centered

    public void SetFlipH(bool flipH)

Setter for FlipH

    public void SetFlipV(bool flipV)

Setter for FlipV

    public void SetFrame(int frame)

Setter for Frame

    public void SetHframes(int hframes)

Setter for Hframes

    public void SetNormalMap(Texture normalMap)

Setter for NormalMap

    public void SetOffset(Vector2 offset)

Setter for Offset

    public void SetRegion(bool enabled)

Setter for RegionEnabled

    public void SetRegionFilterClip(bool enabled)

Setter for RegionFilterClip

    public void SetRegionRect(Rect2 rect)

Setter for RegionRect

    public void SetTexture(Texture texture)

Setter for Texture

    public void SetVframes(int vframes)

Setter for Vframes

Tags: