JugiMap Framework
|
#include <jmGlobal.h>
Public Member Functions | |
void | SetScreenSize (Vec2i _screenSize) |
Set the screen size to the given *_screenSize*. More... | |
Vec2i | GetScreenSize () |
Returns the screen size. More... | |
void | SetYCoordinateUp (bool _yCoordinateUp) |
Set to true if the y coordinate in the used game engine points up. More... | |
bool | IsYCoordinateUp () |
Returns true if the y coordinate points up; if it points down returns false. More... | |
void | EnableSpriteColliders (bool _spriteCollidersEnabled) |
Set to true if the Collider objects should be used for the sprites collision detection. More... | |
bool | SpriteCollidersEnabled () |
Returns true if the Collider objects are used for the sprites collision detection; otherwise returns false. More... | |
void | EnableEnginePhysics (bool _enginePhysicsEnabled) |
Set to false if the engine physics are available in the used engine but disabled. More... | |
bool | EnginePhysicsEnabled () |
Returns true if the engine physics system is enabled; otherwise returns false. More... | |
void | SetErrorMessage (const std::string &_errorMessage) |
Set to true to enable the lerp drawing technique; otherwsie set to false. More... | |
std::string & | GetErrorMessage () |
Returns the global error message. More... | |
void | SetZOrderStep (int _zOrderStep) |
Set the z-order step. Used by engines which use a z-order factor for drawing order of sprites. More... | |
int | GetZOrderStep () |
Returns the z-order step. More... | |
void | SetMapZOrderStart (int _mapZOrderStart) |
Set the starting map z-order. Used by engines which use a z-order factor for drawing order of sprites. More... | |
int | GetMapZOrderStart () |
Returns the starting map z-order. More... | |
void | SetMapZOrderStep (int _mapZOrderStep) |
Set the map z-order step. Used by engines which use a z-order factor for drawing order of sprites. More... | |
int | GetMapZOrderStep () |
Returns the map z-order step. More... | |
void | SetAppTerminated (bool _appTerminated) |
Mark application as terminated on exit. More... | |
bool | IsAppTerminated () |
Returns true if application is marked as terminated; otherwise returns false. More... | |
int | GetRotationSignForYdir () |
Returns the sign of rotation. This sign depends of the direction of y coordinate. More... | |
|
inline |
Set the screen size to the given *_screenSize*.
This function must be called at the game initialization before loading any maps.
|
inline |
Returns the screen size.
|
inline |
Set to true if the y coordinate in the used game engine points up.
This function must be called at the game initialization before loading any maps. The default value is false.
|
inline |
Returns true if the y coordinate points up; if it points down returns false.
|
inline |
Set to true if the Collider objects should be used for the sprites collision detection.
This option is usable only for engines which provide collision system. The function must be called at the game initialization before loading any maps. Collider objects are used for the Sprite interface functions for collision detection. Some engines offer a collision system which is not available via colliders. In that case you can disable colliders and use solely the engine methods for all collision detection tasks in your game.
The default value is true.
|
inline |
Returns true if the Collider objects are used for the sprites collision detection; otherwise returns false.
|
inline |
Set to false if the engine physics are available in the used engine but disabled.
This parameter has no effect with engines which does not provide a physics simulation or it can not be disabled.
The default value is true.
|
inline |
Returns true if the engine physics system is enabled; otherwise returns false.
|
inline |
Set to true to enable the lerp drawing technique; otherwsie set to false.
This option can be used with engines which update game logic with fixed time step.
Lerp drawing describes a technique for reducing the stutter in scrolling or sprite movements which occurs when the game logic rate and the game drawing rate are not synchronized. The lerp drawing means that we obtain the actual drawing position of sprites as an interpolated point between the previous and the current position. The in-between point is calculated via the lerpFactor which should be set in the fixed rate logic of the main game loop.
An important function related to lerp drawing is a function called **CaptureForLerpDrawing*. It is available for maps, layers and sprites. Capture for lerp drawing means that you set the sprite's previous position variable to the same value as the current position. This function must be called at initialization and whenever a sprite changes its position abruptly - the change is not a part of animated (smooth) movement.
If the CaptureForLerpDrawing is not called correctly there may be weird sprite placements in the game. It may be a good idea to temporary disable useLerpDrawing during development and when everything works as intended we activate it to improve smoothness.
The default value is false.
Returns true if the lerp drawing technique is used; otherwise returns false.
see EnableLerpDrawing
Set the interpolating factor for lerp drawing.
The lerp drawing factor is needed if lerp drawing is active and the engine supports it. Important: This function must be called in the game update function in order to regularly provide the current factor.
Returns the interpolating factor for Lerp Drawing.
Set the global error message.
|
inline |
Returns the global error message.
|
inline |
Set the z-order step. Used by engines which use a z-order factor for drawing order of sprites.
|
inline |
Returns the z-order step.
|
inline |
Set the starting map z-order. Used by engines which use a z-order factor for drawing order of sprites.
|
inline |
Returns the starting map z-order.
|
inline |
Set the map z-order step. Used by engines which use a z-order factor for drawing order of sprites.
|
inline |
Returns the map z-order step.
|
inline |
Mark application as terminated on exit.
|
inline |
Returns true if application is marked as terminated; otherwise returns false.
|
inline |
Returns the sign of rotation. This sign depends of the direction of y coordinate.