class

GSDL::Shape

Inherits GSDL::Centerable < GSDL::Tweenable < Reference < Object

Constructors

new(x : Num = 0, y : Num = 0, origin : Tuple(Float32, Float32) = {0_f32, 0_f32}, scale : Tuple(Float32 | Int32, Float32 | Int32) = {1_f32, 1_f32}, rotation : Num = 0, color : Color = Color::White, z_index : Int32 = 0, draw_mode : DrawMode = DrawMode::Fill, border_thickness : Num = 1, border_color : Color = Color::White)
Source

Instance methods

border_color
border_color=(value : Color)
Source
border_thickness
border_thickness=(value : Num)
Source
changed!
Source
changed?
Source
color
color=(value : Color)
Source
draw(draw : Draw)
Source
draw_mode
draw_mode=(value : DrawMode)
Source
draw_relative_to_camera=(draw_relative_to_camera : Bool)
Source
draw_relative_to_camera?
Source
global_x
Source
global_y
Source
height
Source
in?(px : Num, py : Num) : Bool
Source
origin
Source
origin=(origin : Tuple(Float32, Float32))
Source
origin_x
Source
origin_y
Source
render_height
Source
render_width
Source
render_x
Source
render_y
Source
rotate_point(px : Num, py : Num) : FPoint
Source
rotation
rotation=(value : Num)
Source
rotation_radians
Source
scale
scale=(val : Tuple(Num, Num))
Source
scale=(value : ScaleType)
Source
scale_x
Source
scale_x=(val : Num)
Source
scale_y
Source
scale_y=(val : Num)
Source
tweens
Source
update(dt : Float32)
Source
update_geometry

needs to be called at the end of initialization, and in every #draw method (only if #changed?)

Source
width
Source
x
x=(value : Num)

requires

Source
y
y=(value : Num)
Source
z_index
Source
z_index=(z_index : Int32)
Source

Macros

getters_update_geometry(properties)

for getters, with variables calculated inside update_geometry so the variable is updated first ex: alias Vertices = Array(Vertex) getters_update_geometry({fill_vertices : Vertices = [] of Vertex})

outputs to: @fill_vertices : Vertices = [] of Vertex def fill_vertices : Vertices update_geometry if @changed @fill_vertices end

Source
properties_changed(properties)

for creating getter/setter, for variables affecting update_geometry so we know to call update_geometry in draw methods, if this var changes ex: alias Vertices = Array(Vertex) getters_update_geometry({fill_vertices : Vertices = [] of Vertex})

outputs to: @fill_vertices : Vertices = [] of Vertex def fill_vertices : Vertices update_geometry if @changed @fill_vertices end

Source

Nested types