class Glint::Shape::Line

Defined in:

glint/game_object/shape/line.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Glint::Shape::Shape

fill_color : Glint::Color? fill_color, fill_color=(color : Color) fill_color=, outline : Float32 outline, outline=(width : Number) outline=, outline_color : Glint::Color? outline_color, outline_color=(color : Color) outline_color=, outline_position : Glint::Shape::OutlinePosition outline_position, outline_position=(position : OutlinePosition) outline_position=

Instance methods inherited from class Glint::GameObject

<<(other : GameObject) <<, can_update? can_update?, children : Array(GameObject) children, delete(other : GameObject) delete, draw draw, draw_above_children : Bool draw_above_children, draw_above_children=(draw_above_children : Bool) draw_above_children=, draw_at(position) draw_at, draw_children : Bool draw_children, draw_children=(draw_children : Bool) draw_children=, draw_position : DrawPosition draw_position, draw_position=(draw_position : DrawPosition) draw_position=, extents : Dimension extents, game : Game | Nil game, game=(game : Game | Nil) game=, has?(other : GameObject) has?, parent : GameObject | Game | Nil parent, parent=(parent : GameObject | Game | Nil) parent=, pivot : Origin pivot, pivot=(pivot : Origin) pivot=, position : Glint::Vector2 position, position=(position : Glint::Vector2) position=, rotation : Float64 rotation, rotation=(rotation : Float64) rotation=, update(delta)
update(delta, &)
update
, update_mode : UpdateMode update_mode, update_mode=(update_mode : UpdateMode) update_mode=, visible : Bool visible, visible=(visible : Bool) visible=

Class Method Detail

def self.draw(start_position : Position, end_position : Position, width : Float32 = 1, color : Color | Nil = Color::BLACK) #

Draw a line.


[View source]
def self.draw(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, width : Float32 = 1, color : Color = Color::BLACK) #

Draw a line.


[View source]

Instance Method Detail

def color : Glint::Color? #

Returns the color.


[View source]
def color=(color : Color) #

Sets the color.


[View source]
def draw #

Draws the line.


[View source]
def end_position : Glint::Vector2 #

Returns the end position.


[View source]
def end_position=(end_position : Position) #

Sets the end position.


[View source]
def start_position : Glint::Vector2 #

Returns the (start) position.


[View source]
def start_position=(start_position : Position) #

Sets the (start) position.


[View source]
def width : Float32 #

Returns the width.


[View source]
def width=(width : Float32) #

Sets the width.


[View source]