class

FogOfWar::Line

Inherits JSON::Serializable < Reference < Object

Constants

Color = SF::Color.new(38, 25, 17)
PointLineCollisionPrecision = 0.001
Thickness = 8

Constructors

new(points : Array(NamedTuple(x: Int32, y: Int32)) = [] of Point)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

add_point(point : Point)
Source
collision_with_circle?(cx, cy, r)
Source
draw(window : SF::RenderWindow)
Source
draw_line(window, point, next_point)
Source
draw_point_circle(window, point)
Source
line_distance(x1, y1, x2, y2)
Source
lines

TODO: cache this, and uncache if points change

Source
point_in_circle?(px, py, cx, cy, r)
Source
point_in_line?(x1, y1, x2, y2, px, py)
Source
points
Source
thickness
Source