Skip to content

FogExplorationData ​

Inherits: Resource

Stores fog of war exploration data for a single map. Used by WorldContainer to cache and restore fog state between map transitions.

Properties ​

PackedByteArrayexploration_bytesPackedByteArray()
Vector2map_sizeVector2.ZERO
floatlast_updated0.0

Methods ​

FogExplorationDatafrom_image( image: Image, size: Vector2 ) static
Imageget_image()
boolis_valid_for_size( size: Vector2 )
boolhas_data()
voidclear()
intget_data_size()

Property descriptions ​

PackedByteArray exploration_bytes = PackedByteArray() ​

The exploration image as compressed PNG bytes

Vector2 map_size = Vector2.ZERO ​

The map size this data was captured from (for validation)

float last_updated = 0.0 ​

Timestamp when this data was last updated

Method descriptions ​

FogExplorationData from_image( image: Image, size: Vector2 ) ​

Create from an exploration image

Image get_image() ​

Get the exploration image (returns null if no data or decompression fails)

bool is_valid_for_size( size: Vector2 ) ​

Check if this data is valid for a given map size

bool has_data() ​

Check if data exists

void clear() ​

Clear the stored data

int get_data_size() ​

Get size of stored data in bytes (for debugging)