class

Game::Sprite

Inherits Reference < Object

Constants

FPS = 24
SPRITE_DATA_TYPES = [SpriteDataFull, SpriteDataNoFPS, SpriteDataNoLoops, SpriteDataNoStartEndFrames, SpriteDataNoFPSNoStartEndFrames, SpriteDataNoLoopsNoStartEndFrames, SpriteDataNoFPSNoLoopsNoStartEndFrames]

Constructors

get(name) : Sprite

Initialize a new sprite with previously loaded SpriteData attributes

Source
new(name : String, filename : String, width : Int32, height : Int32, fps = FPS, loops = true, start_frame = nil, end_frame = nil)
Source

Class methods

load(name, filename, width, height, fps = FPS, loops = true, start_frame = nil, end_frame = nil)
Source
load(name : Symbol, sprite_data : SpriteDataFull)
Source
load(name : Symbol, sprite_data : SpriteDataNoFPS)
Source
load(name : Symbol, sprite_data : SpriteDataNoLoops)
Source
load(name : Symbol, sprite_data : SpriteDataNoStartEndFrames)
Source
load(name : Symbol, sprite_data : SpriteDataNoFPSNoStartEndFrames)
Source
load(name : Symbol, sprite_data : SpriteDataNoLoopsNoStartEndFrames)
Source
load(name : Symbol, sprite_data : SpriteDataNoFPSNoLoopsNoStartEndFrames)
Source
load(sprites : SpriteData)

Load multiple sprites

Source

Instance methods

animate(frame_time)
Source
clone
Source
cols
Source
done?
Source
draw(image : Image, x = 0, y = 0, centered = false, flip_horizontal = false, flip_vertical = false, tint = Color::White)
Source
draw(x, y, origin_x = nil, origin_y = nil, width = width, height = height, centered = false, rotation = 0, tint = Color::White)
Source
end_frame
Source
end_frame=(end_frame : Int32)
Source
filename
Source
fps=(fps : Int32)
Source
frame
Source
frame=(frame)
Source
frame_time
Source
frames
Source
height
Source
image
Source
loops=(loops : Bool)
Source
loops?
Source
name
Source
pause
Source
paused?
Source
resize(width, height) : Sprite
Source
resize!(width : Int32, height : Int32)
Source
restart
Source
rows
Source
start
Source
start_frame
Source
start_frame=(start_frame : Int32)
Source
texture
Source
update(frame_time)
Source
width
Source

Macros

define_load_sprite_data
Source
define_sprite_data_union
Source

Nested types