class

PointClickEngine::Scenes::WalkableArea

Inherits YAML::Serializable < Reference < Object

Manages walkable and non-walkable regions in a scene using component-based architecture

This refactored WalkableArea class delegates responsibilities to specialized components:

  • PolygonCollisionDetector: Point-in-polygon collision detection
  • WalkablePointFinder: Finding and constraining movement to walkable areas
  • ScaleZoneManager: Character scaling based on Y position
  • WalkBehindManager: Depth sorting for walk-behind regions
  • PolygonRenderer: Debug visualization

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

add_region(region : PolygonRegion) : Nil

Add a walkable/non-walkable region

Source
add_scale_zone(zone : ScaleZone) : Nil

Add a scale zone

Source
add_walk_behind(region : WalkBehindRegion) : Nil

Add a walk-behind region

Source
bounds
Source
bounds=(bounds : RL::Rectangle)
Source
clear_regions

Clear all regions

Source
constrain_to_walkable(from : RL::Vector2, to : RL::Vector2) : RL::Vector2

Constrain movement to walkable area (delegate to finder)

Source
draw_debug

Draw debug visualization

Source
find_nearest_walkable_point(target : RL::Vector2) : RL::Vector2

Find the nearest walkable point to a given position (delegate to finder)

Source
get_scale_at_y(y : Float32) : Float32

Get character scale based on Y position (delegate to manager)

Source
get_stats

Get statistics about the walkable area

Source
get_walk_behind_at_y(y : Float32) : Array(WalkBehindRegion)

Get walk-behind regions that should render in front of a character at given Y

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

Check if a point is within a walkable area

Source
regions
Source
regions=(value : Array(PolygonRegion))

Custom setter for regions that updates bounds

Source
remove_region(name : String) : Bool

Remove a region by name

Source
scale_zones
Source
scale_zones=(value : Array(ScaleZone))
Source
update_bounds

Update the overall bounds

Source
validate

Validate the walkable area configuration

Source
walk_behind_regions

Legacy property accessors for compatibility

Source
walk_behind_regions=(value : Array(WalkBehindRegion))
Source