module
PF2d::Canvas(T)
Included Modules
- Enumerable({PF2d::Vec2(Int32), T})
- PF2d::Drawable(T)
- PF2d::Viewable(T)
Direct including types
Defined in:
pf2d/canvas.crMacro Summary
Instance Method Summary
- #clip(rect : Rect)
-
#draw(canvas : Canvas(T), src_rect : Rect(Number), dst_rect : Rect(Number), &)
Copy canvas to self, yielding a block with src value and dst value that will determine how the values are blended
- #draw(canvas : Canvas(T), pos : Vec = Vec[0, 0], &)
- #draw(canvas : Canvas(T), pos : Vec = Vec[0, 0])
- #draw(canvas : Canvas(T), src_rect : Rect(Number), pos : Vec = Vec[0, 0], &blend)
- #draw(canvas : Canvas(T), src_rect : Rect(Number), pos : Vec = Vec[0, 0])
-
#each(&)
Must yield this collection's elements to the block.
- #each_point(&)
- #each_row(&)
- #height
- #in_bounds?(x, y)
- #in_bounds?(point)
- #rect
-
#size
Returns the number of elements in the collection.
- #width
Instance methods inherited from module PF2d::Viewable(T)
[](x, y)[](point : PF2d::Vec2) [], []?(x, y)
[]?(point : PF2d::Vec2) []?, get_point(x : Number, y : Number) : T
get_point(point : PF2d::Vec2) : T get_point, get_point?(x : Number, y : Number) : T | Nil
get_point?(point : PF2d::Vec2) : T | Nil get_point?
Instance methods inherited from module PF2d::Drawable(T)
[]=(x, y, value)[]=(point, value) []=, draw(point : PF2d::Vec, value : T)
draw(c : Circle, color)
draw(curve : Bezier::Curve, value : T, samples : Int = 100)
draw(line : PF2d::Line, color)
draw(lines : Enumerable(PF2d::Line), color)
draw(rect : PF2d::Rect, value : T)
draw(spline : QuadSpline, value : T, samples : Int = 100, closed : Bool = false) draw, draw_circle(cx : Number, cy : Number, r : Number, color)
draw_circle(c : Vec, r, color) draw_circle, draw_curve(curve : Bezier::Curve, value : T, samples : Int = 100) draw_curve, draw_line(x1 : Int, y1 : Int, x2 : Int, y2 : Int, color)
draw_line(x1 : Number, y1 : Number, x2 : Number, y2 : Number, color)
draw_line(p1 : PF2d::Vec, p2 : PF2d::Vec, color)
draw_line(line : PF2d::Line, color)
draw_line(points : Enumerable(PF2d::Vec), color) draw_line, draw_point(x : Number, y : Number, value : T)
draw_point(point : PF2d::Vec, value : T) draw_point, draw_rect(x1 : Int, y1 : Int, x2 : Int, y2 : Int, value : T)
draw_rect(x1 : Float, y1 : Float, x2 : Float, y2 : Float, value : T)
draw_rect(p1 : PF2d::Vec, p2 : PF2d::Vec, value : T)
draw_rect(rect : PF2d::Rect, value : T)
draw_rect(size : PF2d::Vec, value : T) draw_rect, draw_spline(spline : QuadSpline, value : T, samples : Int = 100, closed : Bool = false) draw_spline, fill(c : Circle, color) fill, fill_circle(cx : Number, cy : Number, r : Number, color)
fill_circle(c : PF2d::Vec, r : Number, color)
fill_circle(c : Circle, color) fill_circle, fill_poly(points : Enumerable(PF2d::Vec), pixel)
fill_poly(*points : PF2d::Vec, pixel) fill_poly, fill_rect(x1 : Int, y1 : Int, x2 : Int, y2 : Int, color)
fill_rect(p1 : PF2d::Vec, p2 : PF2d::Vec, color)
fill_rect(rect : PF2d::Rect, color) fill_rect, fill_spline(spline : QuadSpline, color) fill_spline, fill_splines(splines : Enumerable(QuadSpline), color) fill_splines, fill_triangle(p1 : PF2d::Vec, p2 : PF2d::Vec, p3 : PF2d::Vec, color)
fill_triangle(points : Enumerable(PF2d::Vec), color) fill_triangle, 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) paint_triangle, scan_line(x : Number, y : Number, width : Number, color) scan_line
Macro Detail
Instance Method Detail
Copy canvas to self, yielding a block with src value and dst value that will determine how the values are blended
def each(&)
#
Description copied from module Enumerable({PF2d::Vec2(Int32), T})
Must yield this collection's elements to the block.
def size
#
Description copied from module Enumerable({PF2d::Vec2(Int32), T})
Returns the number of elements in the collection.
[1, 2, 3, 4].size # => 4