class FogOfWar::Line

Included Modules

Defined in:

fog_of_war/line.cr

Constant Summary

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

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(points : Array(NamedTuple(x: Int32, y: Int32)) = [] of Point) #

[View source]

Instance Method Detail

def add_point(point : Point) #

[View source]
def collision_with_circle?(cx, cy, r) #

[View source]
def draw(window : SF::RenderWindow) #

[View source]
def draw_line(window, point, next_point) #

[View source]
def draw_point_circle(window, point) #

[View source]
def line_distance(x1, y1, x2, y2) #

[View source]
def lines #

TODO cache this, and uncache if points change


[View source]
def point_in_circle?(px, py, cx, cy, r) #

[View source]
def point_in_line?(x1, y1, x2, y2, px, py) #

[View source]
def points : Array(Point) #

[View source]
def thickness #

[View source]