class

PointClickEngine::Scenes::PolygonHotspot

Inherits PointClickEngine::Scenes::Hotspot < PointClickEngine::Core::GameObject < PointClickEngine::Core::Drawable < Reference < Object

Polygon-shaped clickable hotspot

Constructors

new(name : String, vertices : Array(RL::Vector2))
Source

Instance methods

add_vertex(point : RL::Vector2)

Add a vertex to the polygon

Source
bounds

Get the bounding rectangle (cached for performance)

Source
calculate_center

Calculate the center point of the polygon

Source
contains_point?(point : RL::Vector2) : Bool

Check if a point is inside the polygon using ray casting algorithm

Source
draw

Draw the polygon hotspot

Source
draw_polygon(color : RL::Color)

Draw filled polygon

Source
draw_polygon_outline(color : RL::Color, thickness : Int32)

Draw polygon outline

Source
get_outline_points

Get outline points for rendering

Source
remove_vertex(index : Int32)

Remove a vertex by index

Source
update_bounds

Update the cached bounds

Source
vertices
Source
vertices=(vertices : Array(RL::Vector2))
Source