class

GSDL::Game

Inherits GSDL::Loadable < Reference < Object

Constants

DefaultBackgroundColor = Color::Black

Constructors

instance
Source
new(title : Nil | String = "", width : Int32 | Nil = 800, height : Int32 | Nil = 600, logical_width : Int32 = 0, logical_height : Int32 = 0, resizable = false, fullscreen = false, maximized = false, minimized = false, borderless = false, always_on_top = false, high_pixel_density : Bool = false, renderer_type : Symbol | Nil = nil, window_flags : Array(SDL3::Window::Flags) | Nil = nil)
Source

Class methods

camera
Source
center_x
Source
center_y
Source
draw
Source
height
Source
loader
Source
org_name

TODO: this should be overriden by consumers for save directory locations communicate this somehow, or make abstract

Source
paused=(val : Bool)
Source
paused?
Source
push(scene : Scene, data : SwitchData | Nil = nil)
Source
quit!
Source
replace(scene : Scene, data : SwitchData | Nil = nil)
Source
scene
Source
size
Source
switch(scene : Scene, data : SwitchData | Nil = nil)
Source
switch_async(scene_class : T.class, data : SwitchData | Nil = nil) forall T
Source
title
Source
title_name

TODO: this should be overriden by consumers for save directory locations communicate this somehow, or make abstract

Source
width
Source
window_height
Source
window_size
Source
window_width
Source

Instance methods

background_color
Source
center_x
Source
center_y
Source
clear_screen
Source
destroy
Source
draw
Source
exit=(exit : Bool)
Source
exit?
Source
fps_counter
Source
height
Source
high_pixel_density=(high_pixel_density : Bool)
Source
high_pixel_density?
Source
joystick_threshold
Source
loader
Source
logical_height
Source
logical_height=(logical_height : Int32)
Source
logical_width

Logical resolution properties

Source
logical_width=(logical_width : Int32)

Logical resolution properties

Source
mouse_cursor_visible
Source
paused=(paused : Bool)
Source
paused?
Source
performance_monitoring_enabled

Enable or disable performance monitoring and metric collection.

Source
performance_monitoring_enabled=(performance_monitoring_enabled : Bool)

Enable or disable performance monitoring and metric collection.

Source
push(scene : Scene, data : SwitchData | Nil = nil)
Source
quit!
Source
register_event_handler(handler : EventHandler)
Source
replace(scene : Scene, data : SwitchData | Nil = nil)
Source
scene
Source
size
Source
switch(scene : Scene, data : SwitchData | Nil = nil)
Source
switch_async(scene_class : T.class, data : SwitchData | Nil = nil) forall T
Source
target_fps

If nil, the frame rate is uncapped (limited only by vsync if enabled). If set to an Integer (e.g., 60), the game loop will delay to match this FPS.

Source
target_fps=(target_fps : Int32 | Nil)

If nil, the frame rate is uncapped (limited only by vsync if enabled). If set to an Integer (e.g., 60), the game loop will delay to match this FPS.

Source
title
Source
toggle_pause
Source
unregister_event_handler(handler : EventHandler)
Source
update(dt : Float32)
Source
vsync
Source
width
Source
window
Source
window_height
Source
window_size
Source
window_width
Source