module PF2d::Drawable(T)
Defined in:
pf2d/drawable.crpf2d/drawable/draw_circle.cr
pf2d/drawable/draw_curve.cr
pf2d/drawable/draw_line.cr
pf2d/drawable/draw_rect.cr
pf2d/drawable/fill_circle.cr
pf2d/drawable/fill_rect.cr
pf2d/drawable/fill_shape.cr
pf2d/drawable/fill_triangle.cr
pf2d/drawable/paint_triangle.cr
Instance Method Summary
-
#draw_circle(cx : Int, cy : Int, r : Int, color)
Draw a circle using Bresenham’s Algorithm
- #draw_circle(c : Vec, r, color)
- #draw_curve(curve : Bezier::Curve, value : T, samples : Int = 100)
-
#draw_line(x1 : Int, y1 : Int, x2 : Int, y2 : Int, color)
Draw a line using Bresenham’s Algorithm
-
#draw_line(x1 : Float, y1 : Float, x2 : Float, y2 : Float, color)
Draw a line using Bresenham’s Algorithm
-
#draw_line(p1 : PF2d::Vec, p2 : PF2d::Vec, color)
Draw a line using Bresenham’s Algorithm
-
#draw_line(line : PF2d::Line, color)
Draw a line using Bresenham’s Algorithm
-
#draw_point(x : Number, y : Number, value : T)
To be implemented by the including class
- #draw_point(point : PF2d::Vec, value : T)
-
#draw_rect(x1 : Number, y1 : Number, x2 : Number, y2 : Number, value : T)
Draws the outline of a rect
-
#draw_rect(p1 : PF2d::Vec, p2 : PF2d::Vec, value : T)
ditto
-
#draw_rect(rect : PF2d::Rect, value : T)
ditto
-
#draw_rect(size : PF2d::Vec, value : T)
ditto
-
#fill_circle(cx : Int, cy : Int, r : Int, color)
Fill a circle using Bresenham’s Algorithm
- #fill_circle(c : PF2d::Vec, r : Int, color)
-
#fill_rect(x1 : Int, y1 : Int, x2 : Int, y2 : Int, color)
Fill a rect
-
#fill_rect(p1 : PF2d::Vec, p2 : PF2d::Vec, color)
ditto
-
#fill_shape(points : Enumerable(PF2d::Vec), pixel)
Fill an abitrary polygon.
-
#fill_shape(*points : PF2d::Vec, pixel)
Fill an abitrary polygon.
-
#fill_triangle(p1 : PF2d::Vec, p2 : PF2d::Vec, p3 : PF2d::Vec, color)
Draw a filled in triangle
-
#fill_triangle(points : Enumerable(PF2d::Vec), color)
ditto
-
#paint_triangle(p1 : PF2d::Vec, p2 : PF2d::Vec, p3 : PF2d::Vec, t1 : PF2d::Vec, t2 : PF2d::Vec, t3 : PF2d::Vec, texture : PF2d::Viewable(T) | Nil, buffer : Drawable(Float), tint : T)
Draw a textured triangle
-
#scan_line(x : Int, y : Int, width : Int, color)
Draw a horizontal line of width
Instance Method Detail
Draw a line using Bresenham’s Algorithm
Draw a line using Bresenham’s Algorithm
Draw a line using Bresenham’s Algorithm
To be implemented by the including class
Draws the outline of a rect
Fill an abitrary polygon. Expects a clockwise winding of points
Fill an abitrary polygon. Expects a clockwise winding of points
Draw a filled in triangle