PopochiuRegion

Inherits: Area2D

Description

Defines areas in a room that trigger events when characters enter or exit.

Regions can apply visual effects such as tinting characters or scaling them based on vertical position (useful for simulating depth in walkable areas).


Properties

Type Name Default
Variant description ""
Variant enabled true
Variant interaction_polygon PackedVector2Array()
Variant interaction_polygon_position Vector2.ZERO
Variant scale_bottom 1.0
Variant scale_top 1.0
Variant scaling false
Variant script_name ""
Variant tint Color.WHITE

Methods

Return Type Method
void _on_character_entered(chr: PopochiuCharacter) virtual
void _on_character_exited(chr: PopochiuCharacter) virtual

Property Descriptions

description

@export var description = ""

Can be used to show the name of the area to players.


enabled

@export var enabled = true
  • Setter: _set_enabled

Whether the region is or not enabled.


interaction_polygon

@export var interaction_polygon = PackedVector2Array()

Stores the vertices to assign to the InteractionPolygon child during runtime. This is used by PopochiuRoom to store the info in its .tscn.


interaction_polygon_position

@export var interaction_polygon_position = Vector2.ZERO

Stores the position to assign to the InteractionPolygon child during runtime. This is used by PopochiuRoom to store the info in its .tscn.


scale_bottom

@export var scale_bottom = 1.0

The scale to apply to the character inside the region when it moves to the bottom (y) of it.


scale_top

@export var scale_top = 1.0

The scale to apply to the character inside the region when it moves to the top (y) of it.


scaling

@export var scaling = false

Whether the region will scale the character while it moves through it.


script_name

@export var script_name = ""

The identifier of the object used in scripts.


tint

@export var tint = Color.WHITE

The Color to apply to the character that enters this region.


Method Descriptions

_on_character_entered

func _on_character_entered(chr: PopochiuCharacter) -> void

This is a virtual method. Override it in your subclass.

Called when chr enters this region.

Implement this to add custom behavior or update the game state.


_on_character_exited

func _on_character_exited(chr: PopochiuCharacter) -> void

This is a virtual method. Override it in your subclass.

Called when chr exits this region.

Implement this to add custom behavior or update the game state.