ESCTerrain
Extends: Node2D
Description
A walkable Terrain for Escoria rooms.
Constants
NONE
const NONE = 0 # enum "DebugMode"
SCALES
const SCALES = 1 # enum "DebugMode"
LIGHTMAP
const LIGHTMAP = 2 # enum "DebugMode"
EscLogger
const EscLogger = <Object>
Logger class reference
Members
scales
var scales: Texture2D
Scaling texture. If empty, items scale will always be 1.0. This is a greyscale image defining how close to the camera the character will appear at each pixel position. White is closer, black is further.
scale_min
var scale_min: float
Minimum scaling. Corresponds to the scale used for characters when they are located at the blackest pixel of scaling texture, at which they will appear smallest. Unused if scaling texture is not set.
scale_max
var scale_max: float
Maximum scaling. Corresponds the scale used for characters when they are located at the whitest pixel of scaling texture, at which they will appear biggest. Unused if scaling texture is not set.
lightmap
var lightmap: Texture2D
Lightmap texture.
lightmap_modulate
var lightmap_modulate: Color
Additional modulator to the lightmap texture.
bitmaps_scale
var bitmaps_scale: Vector2
Scaling factor for the scale and light maps.
player_speed_multiplier
var player_speed_multiplier: float
Multiplier applied to the player speed on this terrain.
player_doubleclick_speed_multiplier
var player_doubleclick_speed_multiplier: float
Multiplier that determines how much faster the player will walk when fast mode is on (double clicked)
editor_debug_mode
var editor_debug_mode: Variant
Debug display mode. None: no debug display Scales: displays the scales map Lightmap: displays the lightmap
logger
var logger: Variant
Logger instance
Methods
get_light
func get_light(pos: Vector2) -> Color
Return the Color of the lightmap pixel for the specified position.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
pos |
|
Position to calculate lightmap for. |
yes |
Returns
Returns a Color value. (Color)
get_scale_range
func get_scale_range(factor: float) -> Vector2
Calculate the scale inside the scale range for a given scale factor.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
factor |
|
The factor for the scaling according to the scale map |
yes |
Returns
Returns a Vector2 value. (Vector2)
get_terrain
func get_terrain(pos: Vector2) -> float
Get the terrain scale factor for a given position
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
pos |
|
The position to calculate for |
yes |
Returns
Returns a float value. (float)
get_simple_path
func get_simple_path(from: Vector2, to: Vector2, optimize: bool, layers: int) -> PackedVector2Array
Calculate a path from a given point to another. The path consists in a list of points.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
from |
|
Origin point |
yes |
to |
|
Destination point |
yes |
optimize |
|
(default is true) enabled optimisation |
no |
layers |
|
bitmask of all region navigation layers that are allowed to be in the path. |
no |
Returns
Returns a PackedVector2Array value. (PackedVector2Array)