-
Notifications
You must be signed in to change notification settings - Fork 0
class_sprite
####Inherits: Node2D ####Category: Core
General purpose Sprite node.
- void
set_texture( Texture texture ) -
Texture
get_texture( ) const - void
set_centered( bool centered ) -
bool
is_centered( ) const - void
set_offset( Vector2 offset ) -
Vector2
get_offset( ) const - void
set_flip_h( bool flip_h ) -
bool
is_flipped_h( ) const - void
set_flip_v( bool flip_v ) -
bool
is_flipped_v( ) const - void
set_region( bool enabled ) -
bool
is_region( ) const - void
set_region_rect( Rect2 rect ) -
Rect2
get_region_rect( ) const - void
set_frame( int frame ) -
int
get_frame( ) const - void
set_vframes( int vframes ) -
int
get_vframes( ) const - void
set_hframes( int hframes ) -
int
get_hframes( ) const - void
set_modulate( Color modulate ) -
Color
get_modulate( ) const
General purpose Sprite node. This Sprite node can show any texture as a sprite. The texture can be used as a spritesheet for animation, or only a region from a bigger texture can referenced, like an atlas.
- void
set_texture( Texture texture )
Set the base texture for the sprite.
-
Texture
get_texture( ) const
Return the base texture for the sprite.
- void
set_centered( bool centered )
Set whether the sprite should be centered on the origin.
-
bool
is_centered( ) const
Return if the sprite is centered at the local origin.
- void
set_offset( Vector2 offset )
Set the sprite draw offset, useful for setting rotation pivots.
-
Vector2
get_offset( ) const
Return sprite draw offst.
- void
set_flip_h( bool flip_h )
Set true to flip the sprite horizontaly.
-
bool
is_flipped_h( ) const
Return true if the sprite is flipped horizontally.
- void
set_flip_v( bool flip_v )
Set true to flip the sprite vertically.
-
bool
is_flipped_v( ) const
Return true if the sprite is flipped vertically.
- void
set_region( bool enabled )
Set the sprite as a sub-region of a bigger texture. Useful for texture-atlases.
-
bool
is_region( ) const
Return if the sprite reads from a region.
- void
set_region_rect( Rect2 rect )
Set the region rect to read from.
-
Rect2
get_region_rect( ) const
Return the region rect to read from.
- void
set_frame( int frame )
Set the texture frame for a sprite-sheet, works when vframes or hframes are greater than 1.
-
int
get_frame( ) const
Return the texture frame for a sprite-sheet, works when vframes or hframes are greater than 1.
- void
set_vframes( int vframes )
Set the amount of vertical frames and converts the sprite into a sprite-sheet. This is useful for animation.
-
int
get_vframes( ) const
Return the amount of vertical frames. See [set_vframes].
- void
set_hframes( int hframes )
Set the amount of horizontal frames and converts the sprite into a sprite-sheet. This is useful for animation.
-
int
get_hframes( ) const
Return the amount of horizontal frames. See [set_hframes].
- void
set_modulate( Color modulate )
Set color modulation for the sprite. All sprite pixels are multiplied by this color.
-
Color
get_modulate( ) const
Return color modulation for the sprite. All sprite pixels are multiplied by this color.