class

GSDL::Triangle

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

Constructors

new(x1 : Num = 0, y1 : Num = 0, x2 : Num = 0, y2 : Num = 0, x3 : Num = 0, y3 : Num = 0, origin : Tuple(Float32, Float32) = {0_f32, 0_f32}, scale : Tuple(Num, Num) = {1_f32, 1_f32}, rotation : Num = 0, color : Color = Color::White, z_index : Int32 = 0, draw_mode : GSDL::Shape::DrawMode = GSDL::Shape::DrawMode::Fill, border_thickness : Num = 1, border_color : Color = Color::White)
Source
new(p1 : Tuple(Num, Num), p2 : Tuple(Num, Num), p3 : Tuple(Num, Num), origin : Tuple(Float32, Float32) = {0_f32, 0_f32}, scale : Tuple(Num, Num) = {1_f32, 1_f32}, rotation : Num = 0, color : Color = Color::White, z_index : Int32 = 0, draw_mode : GSDL::Shape::DrawMode = GSDL::Shape::DrawMode::Fill, border_thickness : Num = 1, border_color : Color = Color::White)
Source

Instance methods

center(x : Num = 0, y : Num = 0, width : Num = 1, height : Num = 1)
Source
collision_bounding_box

collision bounding box of the collidable object as an FRect

Source
collision_polygon_vertices

For polygons, return the absolute coordinates of the vertices

Source
collision_shape
Source
height
Source
indices
Source
render_x1
Source
render_x2
Source
render_x3
Source
render_y1
Source
render_y2
Source
render_y3
Source
update_geometry

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

Source
vertices
Source
width
Source
x1=(x1 : Num)
Source
x2
x2=(value : Num)
Source
x3
x3=(value : Num)
Source
x=(x : Num)

requires

Source
y1=(y1 : Num)
Source
y2
y2=(value : Num)
Source
y3
y3=(value : Num)
Source
y=(y : Num)
Source