Sprite

General purpose Sprite node.

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.

@GodotBaseClass
struct Sprite {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

getFrame
long getFrame()
getHframes
long getHframes()
getNormalMap
Ref!Texture getNormalMap()
getOffset
Vector2 getOffset()
getRect
Rect2 getRect()

Returns a Rect2 representing the Sprite's boundary relative to its local coordinates.

getRegionRect
Rect2 getRegionRect()
getTexture
Ref!Texture getTexture()
getVframes
long getVframes()
isCentered
bool isCentered()
isFlippedH
bool isFlippedH()
isFlippedV
bool isFlippedV()
isPixelOpaque
bool isPixelOpaque(Vector2 pos)
isRegion
bool isRegion()
isRegionFilterClipEnabled
bool isRegionFilterClipEnabled()
opAssign
Sprite opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Sprite other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setCentered
void setCentered(bool centered)
setFlipH
void setFlipH(bool flip_h)
setFlipV
void setFlipV(bool flip_v)
setFrame
void setFrame(long frame)
setHframes
void setHframes(long hframes)
setNormalMap
void setNormalMap(Texture normal_map)
setOffset
void setOffset(Vector2 offset)
setRegion
void setRegion(bool enabled)
setRegionFilterClip
void setRegionFilterClip(bool enabled)
setRegionRect
void setRegionRect(Rect2 rect)
setTexture
void setTexture(Texture texture)
setVframes
void setVframes(long vframes)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

centered
bool centered [@property getter]
bool centered [@property setter]

If true texture is centered. Default value: true.

flipH
bool flipH [@property getter]
bool flipH [@property setter]

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

flipV
bool flipV [@property getter]
bool flipV [@property setter]

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

frame
long frame [@property getter]
long frame [@property setter]

Current frame to display from sprite sheet. vframes or hframes must be greater than 1.

hframes
long hframes [@property getter]
long hframes [@property setter]

The number of columns in the sprite sheet.

normalMap
Texture normalMap [@property getter]
Texture normalMap [@property setter]

The normal map gives depth to the Sprite.

offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]

The texture's drawing offset.

regionEnabled
bool regionEnabled [@property getter]
bool regionEnabled [@property setter]

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

regionFilterClip
bool regionFilterClip [@property setter]

If true the outermost pixels get blurred out.

regionFilterClip
bool regionFilterClip [@property getter]

If true the outermost pixels get blurred out.

regionRect
Rect2 regionRect [@property getter]
Rect2 regionRect [@property setter]

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

texture
Texture texture [@property getter]
Texture texture [@property setter]

Texture object to draw.

vframes
long vframes [@property getter]
long vframes [@property setter]

The number of rows in the sprite sheet.

Static functions

_new
Sprite _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta