Skip to content
Gleb Tsereteli edited this page May 29, 2024 · 20 revisions

Description

RoomLoader's .load(), .load_instances_layer() and .load_instances_depth() methods come with optional flags enum arguments.

Enums are located in the RoomLoaderEnums script.

Enums

ROOMLOADER_FLAG

ROOMLOADER_FLAG holds bitwise flags used for filtering room elements when .load()ing rooms. These can be used individually or combined together using the bitwise OR operator.

Members

Name Description
NONE Doesn't load anything.
INSTANCES Loads Instances from Instance layers.
TILEMAPS Loads Tilemaps from Tile layers.
SPRITES Loads Sprites from Asset layers.
PARTICLE_SYSTEMS Loads Particle Systems from Asset layers.
SEQUENCES Loads Sequences from Asset layers.
BACKGROUNDS Loads Backgrounds from Background layers.
CORE Includes INSTANCES, SPRITES and TILEMAPS.
Used by default via the ROOMLOADER_DEFAULT_FLAGS config macro.
EXTENDED Includes PARTICLE_SYSTEMS, SEQUENCES and BACKGROUNDS.
ALL Includes CORE and EXTENDED.

Example

// Loads rm_chunk_easy_01's Tilemaps:
RoomLoader.load(rm_chunk_easy_01, some_x, some_y, some_origin, ROOMLOADER_FLAG.TILEMAPS);

// Loads rm_chunk_hard_03's Instances, Sprites and Particle Systems: 
var _flags = (ROOMLOADER_FLAG.INSTANCES | ROOMLOADER_FLAG.TILEMAPS | ROOMLOADER_FLAG.PARTICLE_SYSTEMS);
RoomLoader.load(rm_chunk_hard_03, some_x, some_y, some_xorigin, some_yorigin, _flags);

// Loads rm_chunk_mid_02 with flags set to All BUT Sequences:
var _flags = (ROOMLOADER_FLAG.ALL & ~ROOMLOADER_FLAG.SEQUENCES);
RoomLoader.load(rm_chunk_mid_02, some_x, some_y, some_xorigin, some_yorigin, _flags);