JugiMap Framework
Settings Class Reference

Settings. More...

#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...
 

Detailed Description

Settings.

The Settings class stores jugimap configuration parameters.

Member Function Documentation

◆ SetScreenSize()

void SetScreenSize ( Vec2i  _screenSize)
inline

Set the screen size to the given *_screenSize*.

This function must be called at the game initialization before loading any maps.

See also
GetScreenSize

◆ GetScreenSize()

Vec2i GetScreenSize ( )
inline

Returns the screen size.

See also
SetScreenSize

◆ SetYCoordinateUp()

void SetYCoordinateUp ( bool  _yCoordinateUp)
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.

See also
IsYCoordinateUp

◆ IsYCoordinateUp()

bool IsYCoordinateUp ( )
inline

Returns true if the y coordinate points up; if it points down returns false.

See also
SetYCoordinateUp

◆ EnableSpriteColliders()

void EnableSpriteColliders ( bool  _spriteCollidersEnabled)
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.

See also
SpriteCollidersEnabled

◆ SpriteCollidersEnabled()

bool SpriteCollidersEnabled ( )
inline

Returns true if the Collider objects are used for the sprites collision detection; otherwise returns false.

See also
EnableSpriteColliders

◆ EnableEnginePhysics()

void EnableEnginePhysics ( bool  _enginePhysicsEnabled)
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.

See also
EnginePhysicsEnabled

◆ EnginePhysicsEnabled()

bool EnginePhysicsEnabled ( )
inline

Returns true if the engine physics system is enabled; otherwise returns false.

See also
EnableEnginePhysics

◆ SetErrorMessage()

void SetErrorMessage ( const std::string &  _errorMessage)
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.

See also
LerpDrawingEnabled

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.

See also
GetLerpDrawingFactor

Returns the interpolating factor for Lerp Drawing.

See also
SetLerpDrawingFactor

Set the global error message.

◆ GetErrorMessage()

std::string& GetErrorMessage ( )
inline

Returns the global error message.

◆ SetZOrderStep()

void SetZOrderStep ( int  _zOrderStep)
inline

Set the z-order step. Used by engines which use a z-order factor for drawing order of sprites.

◆ GetZOrderStep()

int GetZOrderStep ( )
inline

Returns the z-order step.

◆ SetMapZOrderStart()

void SetMapZOrderStart ( int  _mapZOrderStart)
inline

Set the starting map z-order. Used by engines which use a z-order factor for drawing order of sprites.

◆ GetMapZOrderStart()

int GetMapZOrderStart ( )
inline

Returns the starting map z-order.

◆ SetMapZOrderStep()

void SetMapZOrderStep ( int  _mapZOrderStep)
inline

Set the map z-order step. Used by engines which use a z-order factor for drawing order of sprites.

◆ GetMapZOrderStep()

int GetMapZOrderStep ( )
inline

Returns the map z-order step.

◆ SetAppTerminated()

void SetAppTerminated ( bool  _appTerminated)
inline

Mark application as terminated on exit.

◆ IsAppTerminated()

bool IsAppTerminated ( )
inline

Returns true if application is marked as terminated; otherwise returns false.

◆ GetRotationSignForYdir()

int GetRotationSignForYdir ( )
inline

Returns the sign of rotation. This sign depends of the direction of y coordinate.


The documentation for this class was generated from the following file: