{{tag>zxt:extension}} ====== 0000a51e:0007 - Viewport control [DRAFT] ====== ===== Flags ===== ^ Flag ^ Set? (MUST/MAY/...) ^ Description ^ | parsing_must | MUST NOT | | | reading_must | MUST NOT | | | writing_must | MUST NOT | | | playing_should | MAY | | | playing_must | SHOULD NOT | Please don't make games which depend on this. | | editing_should | MUST NOT | ... What about syntax highlighting? | ===== Field data ===== None. (TODO: The extension probably needs to store the current viewport location for savefiles.) ===== Description ===== This extension defines the concept of a "viewport", loosely inspired by Super ZZT. This extension also provides OOP commands for controlling the active viewport: * ''#VIEWPORT [LOCK|UNLOCK]'' - Locks or unlocks the viewport. By default, the viewport is unlocked - this means that movement of the player stat will return focus back to the player. (Whether this also includes failed movement //attempts// is undefined.) Locking the viewport means that player movement will not return focus back to the player. If the current stat in focus is the player, a locked viewport will remain in place. * ''#VIEWPORT FOCUS PLAYER'' - Returns viewport camera focus to the player. Importantly, this also unlocks the viewport. * ''#VIEWPORT FOCUS [target]'' - Centers the viewport camera on the provided target (''SELF'', or a target name). * ''#VIEWPORT MOVE [direction]'' - Moves the viewport camera by the specified direction, relative to the center of the viewport, rounded down. The following additional rules apply: * If the currently focused stat is removed, and the stat is not the player, the viewport is returned to the player and unlocked as if ''#VIEWPORT FOCUS PLAYER'' were called. ===== Implementations ===== TBD