Viewport#
version
2.55.9 - Basic, read-only access
version
3.0 - Full access via Viewport->Mode
Defines the visible portion of the current Region - aka, what the player currently sees.
For an example usage, see: ZQuestClassic/ZQuestClassic
Variables#
Functions#
Enumerations#
enum ViewportMode: π Source
ViewportMode VIEW_MODE_CENTER_AND_BOUND = 0L
Position the viewport such that the Viewport::Target is in the middle of it (but bounded by the edges of the current region).
ViewportMode VIEW_MODE_CENTER = 1L
Position the viewport such that the Viewport::Target is in the middle of it, always. Screens outside the current region are rendered as black.
ViewportMode VIEW_MODE_SCRIPT = 2L
Disable the engineβs updating of the viewport on every frame, and instead defer to values set by scripts.
Variable descriptions#
ViewportMode Mode π Source
Defaults to VIEW_MODE_CENTER_AND_BOUND, and is reset at the beginning of scrolling.
The sprite that the viewport is centered around. If this sprite no longer exists, this will be reset to the Hero sprite.
Defaults to Hero, and is reset at the beginning of scrolling.
Unless Mode is VIEW_MODE_SCRIPT, this is updated every frame by the engine.
Unless Mode is VIEW_MODE_SCRIPT, this is updated every frame by the engine.
Function descriptions#
bool Contains(sprite s) π Source
version
3.0
Returns true if the given sprite is visible within the viewport.
Note: this function ignores the fact that the bottom 8 pixels are never visible.
bool Contains(int x, int y) π Source
Returns true if the given point is visible within the viewport.
Note: this function ignores the fact that the bottom 8 pixels are never visible.