class

GSDL::SpriteBase

Inherits GSDL::Directionable < GSDL::Area < GSDL::Collidable < GSDL::Centerable < GSDL::Entity < GSDL::Saveable < GSDL::Tweenable < Reference < Object

Constructors

new(key : Symbol, x : Num = 0, y : Num = 0, origin = {0_f32, 0_f32}, scale = {1_f32, 1_f32}, tint : Color | Nil = nil)
Source

Instance methods

area_bounding_box

override this method in parent class for custom area box

Source
collision_bounding_box

override this method in parent class for custom collision box

Source
draw(draw : Draw)
Source
draw_relative_to_camera=(draw_relative_to_camera : Bool)
Source
draw_relative_to_camera?
Source
flip_h=(flip_h : Bool)
Source
flip_h?
Source
flip_v=(flip_v : Bool)
Source
flip_v?
Source
ground_y

The ground position (bottom) of the sprite, ignoring any height/oblique offsets. Used for depth sorting in 3/4 perspective.

Source
height
Source
on_screen?
Source
render_height
Source
render_offset_y
Source
render_offset_y=(render_offset_y : Float32)
Source
render_width
Source
render_x

requires

Source
render_y
Source
rotation
Source
rotation=(rotation : Num)
Source
size
Source
texture
Source
tint
Source
tint=(tint : Color | Nil)
Source
update(dt : Float32) : Bool

Base update logic for all sprites. Returns true if the sprite is on-screen and should continue updating, or false if the subclass should abort its update.

ALWAYS call return unless super(dt) at the top of your custom update methods.

Source
update_off_screen
Source
update_off_screen=(update_off_screen : Bool)
Source
width
Source