PF2d::Drawable(T)
Instance methods
[]=(x, y, value)
Source[]=(point, value)
Sourcedraw(c : Circle, color)
Sourcedraw(curve : Bezier::Curve, value : T, samples : Int = 100)
Sourcedraw(line : PF2d::Line, color)
Sourcedraw(spline : QuadSpline, value : T, samples : Int = 100, closed : Bool = false)
Sourcedraw_circle(cx : Number, cy : Number, r : Number, color)
Draw a circle using Bresenham’s Algorithm
draw_circle(c : Vec, r, color)
Sourcedraw_curve(curve : Bezier::Curve, value : T, samples : Int = 100)
Sourcedraw_line(x1 : Number, y1 : Number, x2 : Number, y2 : Number, color)
Draw a line using Bresenham’s Algorithm
draw_line(x1 : Number, y1 : Number, x2 : Number, y2 : Number, color, &blend : T, T -> T)
Sourcedraw_line(line : PF2d::Line, color)
SourceBlends a point onto Drawable - requires Viewable
draw_rect(x1 : Float, y1 : Float, x2 : Float, y2 : Float, value : T)
Sourcedraw_spline(spline : QuadSpline, value : T, samples : Int = 100, closed : Bool = false)
Sourcefill(c : Circle, color)
Sourcefill_circle(cx : Number, cy : Number, r : Number, color)
Fill a circle using Bresenham’s Algorithm
fill_circle(c : Circle, color)
SourceFill an abitrary polygon. Expects a clockwise winding of points TODO: create function to determine if inside poly
fill_poly(*points : PF2d::Vec, pixel)
Fill an abitrary polygon. Expects a clockwise winding of points TODO: create function to determine if inside poly
fill_rect(rect : PF2d::Rect, color)
Sourcefill_splines(splines : Enumerable(QuadSpline), color)
Fills a spline by the clockwise winding rule
Draw a filled in triangle
map_line(x1 : Int, y1 : Int, x2 : Int, y2 : Int, &)
Use Bresenham’s Algorithm to calculate points
paint_triangle(p1 : PF2d::Vec3(Float), p2 : PF2d::Vec3(Float), p3 : PF2d::Vec3(Float), t1 : PF2d::Vec, t2 : PF2d::Vec, t3 : PF2d::Vec, texture : PF2d::Viewable(T) | Nil, buffer : Drawable(Float), tint : T)
Sourcepaint_triangle(p1 : PF2d::Vec3(Int), p2 : PF2d::Vec3(Int), p3 : PF2d::Vec3(Int), 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, &blend : T, T -> T)
Source