class Game::Line

Defined in:

game/shapes/line.cr

Constant Summary

DEFAULT_THICKNESS = 1

Constructors

Instance Method Summary

Instance methods inherited from class Game::Shape

color : Color color, color=(color : Color) color=, draw(image : Image, parent_x = 0, parent_y = 0)
draw(parent_x = 0, parent_y = 0)
draw
, draw_filled(image : Image, parent_x = 0, parent_y = 0)
draw_filled(parent_x = 0, parent_y = 0)
draw_filled
, draw_outlined(image : Image, parent_x = 0, parent_y = 0)
draw_outlined(parent_x = 0, parent_y = 0)
draw_outlined
, filled=(filled : Bool) filled=, filled? : Bool filled?, height height, height=(_height) height=, update(_frame_time) update, width width, width=(_width) width=, x x, x=(_x) x=, y y, y=(_y) y=

Constructor methods inherited from class Game::Shape

new(color, filled : Bool = FILLED) new

Constructor Detail

def self.new(end_x : Float32 | Int32, end_y : Float32 | Int32, start_x : Float32 | Int32 = 0, start_y : Float32 | Int32 = 0, color = nil, thickness : Float32 | Int32 = DEFAULT_THICKNESS, filled = Shape::FILLED) #

[View source]

Instance Method Detail

def color=(value : Int32 | Float32) #

[View source]
def draw_filled(parent_x = 0, parent_y = 0) #

[View source]
def draw_line(parent_x = 0, parent_y = 0, color = @color) #

[View source]
def draw_outlined(parent_x = 0, parent_y = 0) #

[View source]
def end_x : Int32 | Float32 #

[View source]
def end_x=(value : Int32 | Float32) #

[View source]
def end_y : Int32 | Float32 #

[View source]
def end_y=(value : Int32 | Float32) #

[View source]
def height #

[View source]
def height=(height) #

[View source]
def rectangle #

[View source]
def start_x : Int32 | Float32 #

[View source]
def start_x=(value : Int32 | Float32) #

[View source]
def start_y : Int32 | Float32 #

[View source]
def start_y=(value : Int32 | Float32) #

[View source]
def thickness : Int32 | Float32 #

[View source]
def thickness=(value : Int32 | Float32) #

[View source]
def width #

[View source]
def width=(width) #

[View source]
def x #

TODO needs to be reworked since start x,y isn't always top left


[View source]
def x=(x : Float32 | Int32) #

[View source]
def y #

TODO needs to be reworked since start x,y isn't always top left


[View source]
def y=(y : Float32 | Int32) #

[View source]