Region#
Changed in version 3.0: Fully implemented
A region is a set of map screens that the player can freely move within.
The top-left screen of a region is called the “origin screen”. Game->CurScreen is always equal to the current region’s origin screen.
A region with just a single screen is technically still a region, but is referred to as a “non-scrolling region”. A region larger than one screen is a “scrolling region”.
The visible porition of the region currently visible is defined by the Viewport.
To configure the actual region layout, see ClearRegion() and SetRegion().
Access with Region->
.
Tutorials#
Variables#
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const long |
Functions#
bool |
IncludesScreen(int screen) |
int |
RelativeScreenX(int screen) |
int |
RelativeScreenY(int screen) |
int |
WorldOffsetX(int screen) |
int |
WorldOffsetY(int screen) |
Variable descriptions#
The number of pixels horizontally. 256 per screen.
The number of pixels vertically. 176 per screen.
const int ScreenWidth 🔗 Source
The number of screens horizontally.
const int ScreenHeight 🔗 Source
The number of screens vertically.
The number of combo positions. 176 per screen. This is the same as NUM_COMBO_POS.
const long OriginScreenIndex 🔗 Source
The index of the top-left screen in the current region. This is the same as Game->CurScreen.
Function descriptions#
bool IncludesScreen(int screen) 🔗 Source
Returns true if the given screen index is inside the current region. When not in a region, only returns true if screen is equal to Game->CurScreen.
int RelativeScreenX(int screen) 🔗 Source
Given a screen index, returns the screen offset in the X direction in the current region. Returns 0 if a screen is not in the current region.
Example: If the current region is 4x4 and the origin is screen 5, RelativeScreenX(8) == 3
.
int RelativeScreenY(int screen) 🔗 Source
Given a screen index, returns the screen offset in the Y direction in the current region. Returns 0 if a screen is not in the current region.
Example: If the current region is 4x4 and the origin is screen 5, RelativeScreenY(8) == 3
.
int WorldOffsetX(int screen) 🔗 Source
Given a screen index, returns the world offset in the x direction for the current region.
int WorldOffsetY(int screen) 🔗 Source
Given a screen index, returns the world offset in the y direction for the current region.
Added in version 2.55.9: Added for compatability. Variables never vary (besides Region->OriginScreenIndex)