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/draw_spline.cr
pf2d/drawable/fill_circle.cr
pf2d/drawable/fill_poly.cr
pf2d/drawable/fill_rect.cr
pf2d/drawable/fill_spline.cr
pf2d/drawable/fill_triangle.cr
pf2d/drawable/paint_triangle.cr
Constant Summary
-
EPSILON =
1e-6
Instance Method Summary
-
#draw_circle(cx : Number, cy : Number, r : Number, 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 : Int, y1 : Int, x2 : Int, y2 : Int, value : T)
Draws the outline of a rect
- #draw_rect(x1 : Float, y1 : Float, x2 : Float, y2 : Float, value : T)
-
#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
- #draw_spline(spline : QuadSpline, value : T, samples : Int = 100, closed : Bool = false)
-
#fill_circle(cx : Number, cy : Number, r : Number, color)
Fill a circle using Bresenham’s Algorithm
- #fill_circle(c : PF2d::Vec, r : Number, color)
-
#fill_poly(points : Enumerable(PF2d::Vec), pixel)
Fill an abitrary polygon.
-
#fill_poly(*points : PF2d::Vec, pixel)
Fill an abitrary polygon.
-
#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_spline(spline : QuadSpline, color)
Fills a spline by the clockwise winding rule
-
#fill_splines(splines : Enumerable(QuadSpline), color)
Fills a spline by the clockwise winding rule
-
#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 : Number, y : Number, width : Number, color)
Draw a horizontal line of width
Instance Method Detail
Draw a circle using Bresenham’s Algorithm
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
Fill a circle using Bresenham’s Algorithm
Fill an abitrary polygon. Expects a clockwise winding of points
Fill an abitrary polygon. Expects a clockwise winding of points
Fills a spline by the clockwise winding rule
Draw a filled in triangle
Draw a textured triangle