Origin β
All Loading and Screenshotting methods have optional [xOrigin] and [yOrigin] parameters that define the origin point for the target room.
These parameters are relative, ranging from 0 (no offset) to 1 (full width/height). Any value between 0 and 1 (inclusive) is valid.
xOrigindetermines the horizontal origin.0aligns to the left,0.5to the center, and1to the right. Defaults to the ROOMLOADER_DEFAULT_XORIGIN config macro.yOrigindetermines the vertical origin.0aligns to the top,0.5to the center, and1to the bottom. Defaults to the ROOMLOADER_DEFAULT_YORIGIN config macro.
TIP
In addition to using origins as optional arguments, they can also be preconfigured before Loading or Screenshotting using the Origin State system.
js
// Loads rmChunkEasy01 at the bottom right corner of the current room:
RoomLoader.Load(rmChunkEasy01, room_width, room_height, 1, 1);
// Takes a screenshot of rmLevelCliffs with a centered origin:
screenshot = RoomLoader.Screenshot(rmLevelCliffs, 0.5, 0.5); js
// Loads rmChunkEasy01 at the bottom right corner of the current room:
RoomLoader.BottomRight().Load(rmChunkEasy01, room_width, room_height);
// Takes a screenshot of rmLevelCliffs with a centered origin:
screenshot = RoomLoader.MiddleCenter().Screenshot(rmLevelCliffs);