class

PointClickEngine::Scenes::HotspotManager

Inherits Reference < Object

Manages hotspots and their interactions within a scene

The HotspotManager handles all hotspot-related functionality including:

  • Hotspot collection management
  • Position-based hotspot detection
  • Hotspot-object relationship management
  • Interaction coordination

Constructors

Instance methods

add_hotspot(hotspot : Hotspot)

Adds a hotspot to the collection

  • hotspot : The hotspot to add
Source
all_hotspots

Gets all hotspots in the collection

Source
clear_hotspots

Clears all hotspots

Source
disable_spatial_optimization

Disables spatial optimization

Source
enable_spatial_optimization(grid_size : Int32 = 100)

Enables spatial optimization for better performance with many hotspots

Source
export_hotspots

Exports hotspot data for external tools

Source
get_hotspot_at(position : RL::Vector2) : Hotspot | Nil

Finds the topmost hotspot at a specific position

Searches through all hotspots to find the one with the highest z-order (drawn last) that contains the given point.

  • position : The position to check

Returns: The topmost hotspot at the position, or nil if none found

Source
get_hotspot_by_name(name : String) : Hotspot | Nil

Gets a hotspot by name

  • name : Name of the hotspot to find

Returns: The hotspot with the given name, or nil if not found

Source
get_hotspots_at(position : RL::Vector2) : Array(Hotspot)

Gets all hotspots at a specific position

Returns all hotspots that contain the given point, ordered by z-order.

  • position : The position to check

Returns: Array of hotspots at the position

Source
get_hotspots_in_area(area : RL::Rectangle) : Array(Hotspot)

Finds hotspots within a rectangular area

  • area : The rectangular area to search within

Returns: Array of hotspots that intersect with the area

Source
get_hotspots_in_radius(center : RL::Vector2, radius : Float32) : Array(Hotspot)

Finds hotspots within a circular area

  • center : Center point of the circle
  • radius : Radius of the circle

Returns: Array of hotspots within the circular area

Source
get_statistics

Gets hotspot statistics for debugging

Source
has_hotspot_at?(position : RL::Vector2) : Bool

Checks if any hotspot exists at the given position

  • position : The position to check

Returns: true if any hotspot contains the position

Source
hotspot_count

Gets count of hotspots

Source
hotspots

Collection of hotspots in the scene

Source
hotspots=(hotspots : Array(Hotspot))

Collection of hotspots in the scene

Source
import_hotspots(data : Array(Hash(String, String | Int32 | Float32)))

Imports hotspot data from external source

Source
remove_hotspot(hotspot : Hotspot)

Removes a hotspot from the collection

  • hotspot : The hotspot to remove
Source
remove_hotspot_by_name(name : String)

Removes a hotspot by name

  • name : Name of the hotspot to remove
Source
sort_hotspots_by_depth

Sorts hotspots by their z-order (drawing order)

Source
spatial_grid_size

Grid size for spatial partitioning (when enabled)

Source
spatial_grid_size=(spatial_grid_size : Int32)

Grid size for spatial partitioning (when enabled)

Source
update_hotspot_positions

Updates hotspot positions and refreshes spatial cache

Source
use_spatial_optimization

Whether to use spatial optimization for large numbers of hotspots

Source
use_spatial_optimization=(use_spatial_optimization : Bool)

Whether to use spatial optimization for large numbers of hotspots

Source
validate_hotspots

Validates all hotspots for consistency

Checks for overlapping hotspots, invalid dimensions, etc.

Returns: Array of validation issues found

Source