constantsο
Accessible constants are the following:
General purpose:
PYGAMELIB_VERSION
- enum pygamelib.constants.Alignment(value)ο
Alignment regroup constants that used for various alignment purpose when organizing UI elements or other such graphical elements.
V_CENTER and H_CENTER respectively stand for Vertical center and Horizontal Center.
- Member Type:
int
Valid values are as follows:
- LEFT = <Alignment.LEFT: 30000011>ο
- RIGHT = <Alignment.RIGHT: 30000100>ο
- CENTER = <Alignment.CENTER: 30000101>ο
- TOP = <Alignment.TOP: 30000110>ο
- BOTTOM = <Alignment.BOTTOM: 30000111>ο
- V_CENTER = <Alignment.V_CENTER: 30001000>ο
- H_CENTER = <Alignment.H_CENTER: 30001001>ο
- enum pygamelib.constants.Algorithm(value)ο
A set of constants to identify the different algorithms used in the library (when a choice is possible). For now, itβs only the path finding algorithm.
- Member Type:
int
Valid values are as follows:
- BFS = <Algorithm.BFS: 90000100>ο
- ASTAR = <Algorithm.ASTAR: 90000101>ο
- enum pygamelib.constants.Direction(value)ο
Direction hold the basic constants for directions in the pygamelib. It is used for a wide variety of use cases from moving a player or NPC to indicate the direction of the movement of a cursor in the UI module!
- Member Type:
int
Valid values are as follows:
- NO_DIR = <Direction.NO_DIR: 10000000>ο
- UP = <Direction.UP: 10000001>ο
- DOWN = <Direction.DOWN: 10000010>ο
- LEFT = <Direction.LEFT: 10000011>ο
- RIGHT = <Direction.RIGHT: 10000100>ο
- DRUP = <Direction.DRUP: 10000101>ο
- DRDOWN = <Direction.DRDOWN: 10000110>ο
- DLUP = <Direction.DLUP: 10000111>ο
- DLDOWN = <Direction.DLDOWN: 10001000>ο
- enum pygamelib.constants.EngineConstant(value)ο
A couple of constants that controls the behavior of the engine itself.
- Member Type:
int
Valid values are as follows:
- NO_PLAYER = <EngineConstant.NO_PLAYER: 90000001>ο
- enum pygamelib.constants.EngineMode(value)ο
Constants that controls the mode of the engine. So far, itβs a choice between real time and turn by turn, but in the future there could be additional modes.
- Member Type:
int
Valid values are as follows:
- MODE_REAL_TIME = <EngineMode.MODE_REAL_TIME: 90000002>ο
- MODE_TURN_BY_TURN = <EngineMode.MODE_TURN_BY_TURN: 90000003>ο
- enum pygamelib.constants.InputValidator(value)ο
InputValidators are used in the UI module to indicate what type of inputs are valid and/or accepted from the user.
- Member Type:
int
Valid values are as follows:
- INTEGER_FILTER = <InputValidator.INTEGER_FILTER: 50000001>ο
- PRINTABLE_FILTER = <InputValidator.PRINTABLE_FILTER: 50000002>ο
- enum pygamelib.constants.Orientation(value)ο
Orientation regroup constants that are used to describe the orientation of graphical elements. The best example, is the BoxLayout: it can be organized vertically or horizontally.
- Member Type:
int
Valid values are as follows:
- HORIZONTAL = <Orientation.HORIZONTAL: 30000001>ο
- VERTICAL = <Orientation.VERTICAL: 30000010>ο
- enum pygamelib.constants.Permission(value)ο
Permission constants to separate what objects are allowed to interact with others. Mostly used to separate NPCs from Players.
- Member Type:
int
Valid values are as follows:
- PLAYER_AUTHORIZED = <Permission.PLAYER_AUTHORIZED: 20000001>ο
- NPC_AUTHORIZED = <Permission.NPC_AUTHORIZED: 20000010>ο
- ALL_CHARACTERS_AUTHORIZED = <Permission.ALL_CHARACTERS_AUTHORIZED: 20000011>ο
- ALL_MOVABLE_AUTHORIZED = <Permission.ALL_MOVABLE_AUTHORIZED: 20000100>ο
- NONE_AUTHORIZED = <Permission.NONE_AUTHORIZED: 20000101>ο
- enum pygamelib.constants.SizeConstraint(value)ο
SizeConstraint regroup constants that are used in element which the size can vary depending on context.
- Member Type:
int
Valid values are as follows:
- DEFAULT_SIZE = <SizeConstraint.DEFAULT_SIZE: 60000001>ο
- MINIMUM_SIZE = <SizeConstraint.MINIMUM_SIZE: 60000002>ο
- MAXIMUM_SIZE = <SizeConstraint.MAXIMUM_SIZE: 60000003>ο
- EXPAND = <SizeConstraint.EXPAND: 60000004>ο
- enum pygamelib.constants.State(value)ο
A set of constants that describe the internal state of something. For example the, state of the
Game
engine that are used to process or not some events.- Member Type:
int
Valid values are as follows:
- RUNNING = <State.RUNNING: 40000001>ο
- PAUSED = <State.PAUSED: 40000010>ο
- STOPPED = <State.STOPPED: 40000011>ο
- enum pygamelib.constants.TextStyle(value)ο
TextStyling is used to format characters or text. It is mostly used by
Text
.- Member Type:
str
Valid values are as follows:
- BOLD = <TextStyle.BOLD: '\x1b[1m'>ο
- UNDERLINE = <TextStyle.UNDERLINE: '\x1b[4m'>ο
The following constants are used in versions <= 1.3.0 and have been deprecated starting version 1.4.0.
Directions:
NO_DIR: This one is used when no direction can be provided by an actuator (destination reached for a PathFinder for example)
UP
DOWN
LEFT
RIGHT
DRUP : Diagonal right up
DRDOWN : Diagonal right down
DLUP : Diagonal Left up
DLDOWN : Diagonal left down
Permissions:
PLAYER_AUTHORIZED
NPC_AUTHORIZED
ALL_PLAYABLE_AUTHORIZED (deprecated in 1.2.0 in favor of ALL_CHARACTERS_AUTHORIZED)
ALL_CHARACTERS_AUTHORIZED
ALL_MOVABLE_AUTHORIZED
NONE_AUTHORIZED
UI positions:
ORIENTATION_HORIZONTAL
ORIENTATION_VERTICAL
ALIGN_LEFT
ALIGN_RIGHT
ALIGN_CENTER
Actions states (for Actuators for example):
RUNNING
PAUSED
STOPPED
Accepted input (mainly used in pygamelib.gfx.ui for input dialogs): * INTEGER_FILTER * PRINTABLE_FILTER
Path Finding Algorithm Constants:
ALGO_BFS
ALGO_ASTAR
Text styling constants:
BOLD
UNDERLINE
Special constants:
NO_PLAYER : That constant is used to tell the Game object not to manage the player.
MODE_RT : Set the game object to Real Time mode. The game runs independently from the user input.
MODE_TBT : Set the game object to Turn By Turn mode. The game runs turn by turn and pause between each user input.