ESCTerrain

Extends: Navigation2D

Description

A walkable Terrains

Enumerations

DebugMode

const DebugMode: Dictionary = {"LIGHTMAP":2,"NONE":0,"SCALES":1}

Visualize scales or the lightmap for debugging purposes

Constants Descriptions

Logger

const Logger: GDScript = preload("res://addons/escoria-core/game/esc_logger.gd")

Logger class

Property Descriptions

scales

export var scales = "[Object:null]"

Scaling texture

scale_min

export var scale_min = 0.3

Minimum scaling

scale_max

export var scale_max = 1

Maximum scaling

lightmap

export var lightmap = "[Object:null]"

Lightmap texture

bitmaps_scale

export var bitmaps_scale = "(1, 1)"

The scaling factor for the scale and light maps

player_speed_multiplier

export var player_speed_multiplier = 1

Multiplier applied to the player speed on this terrain

player_doubleclick_speed_multiplier

export var player_doubleclick_speed_multiplier = 1.5

Multiplier how much faster the player will walk when fast mode is on (double clicked)

lightmap_modulate

export var lightmap_modulate = "1,1,1,1"

Additional modulator to the lightmap texture

debug_mode

export var debug_mode = 0

Currently selected debug visualize mode

current_active_navigation_instance

var current_active_navigation_instance: NavigationPolygonInstance

The currently activ navigation polygon

logger

var logger

Logger instance

Method Descriptions

get_light

func get_light(pos: Vector2) -> Color

Return the Color of the lightmap pixel for the specified position

Parameters

  • pos: Position to calculate lightmap for Returns The color of the given point

get_scale_range

func get_scale_range(factor: float) -> Vector2

Calculate the scale inside the scale range for a given scale factor

Parameters

  • factor: The factor for the scaling according to the scale map Returns The scaling

get_terrain

func get_terrain(pos: Vector2) -> float

Get the terrain scale factor for a given position

Parameters

  • pos: The position to calculate for Returns The scale factor for the given position