Bandidos
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
com.mygdx.game.engine.Engine Class Reference

Public Member Functions

 Engine (String title, int width, int height, int scale, int frameRate, BaseTextureResources textureResources, BaseAudioResources audioResources, BaseFontResources fontResources)
 
void setScenesManager (BaseScenesManager manager)
 
void update ()
 

Static Public Member Functions

static AssetManager getAssetManager ()
 
static BaseScenesManager getSceneManager ()
 
static BaseFontResources getFontResources ()
 
static BaseTextureResources getTextureResources ()
 
static BaseAudioResources getAudioResources ()
 
static String getTitle ()
 
static int getWidth ()
 
static int getHeight ()
 
static int getFrameRate ()
 
static float getFrameStep ()
 

Static Public Attributes

static float TimeScale = 1f
 

Detailed Description

This class should be instantiated at the core of the workspace. It will be the holder and handler for all the core Game Systems and should be updated for it to run. It will handle its own Update loop and will keep it at the given FrameRate. Create a window with the given width, height and title and will hold all the Resources If you want to load a resource, know the size of the screen, get access to scene management or rendering. They are all available as static fields which can be accessed by any class.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ Engine()

com.mygdx.game.engine.Engine.Engine ( String  title,
int  width,
int  height,
int  scale,
int  frameRate,
BaseTextureResources  textureResources,
BaseAudioResources  audioResources,
BaseFontResources  fontResources 
)

This creates the core of the game system. The Engine should be updated in a loop by calling the 'update' method Do not forget to call the 'setScenesManager' method to set the scene manager.

Parameters
titleto give the game window
widthis the width to make the game window in pixels
heightis the height to make the game window in pixels
scaleis how much to scale the window size (width and height)
frameRateis the frame rate the game should run on (60 fps recommended)
textureResourcesis the texture resources instance which has the loadResource calls for all the game textures
audioResourcesis the audio resources instance which has the loadResource calls for all the game audio
fontResourcesis the font resources instance which has the loadResource calls for all the game fonts

Member Function Documentation

◆ getAssetManager()

static AssetManager com.mygdx.game.engine.Engine.getAssetManager ( )
static

Returns the AssetManager which is keeps track on how much is loaded of all the resources

Returns
The AssetManager of the Engine (Can be used for loading screens)

◆ getAudioResources()

static BaseAudioResources com.mygdx.game.engine.Engine.getAudioResources ( )
static

Returns the AudioResources instance given in the Engine Constructor

Returns
AudioResources instance given in the Engine Constructor

◆ getFontResources()

static BaseFontResources com.mygdx.game.engine.Engine.getFontResources ( )
static

Returns the FontResources instance given in the Engine Constructor

Returns
FontResources instance given in the Engine Constructor

◆ getFrameRate()

static int com.mygdx.game.engine.Engine.getFrameRate ( )
static

Returns the given Frame Rate of the game

Returns
Returns the set frame rate as integer.

◆ getFrameStep()

static float com.mygdx.game.engine.Engine.getFrameStep ( )
static

Gets the Time it would take to complete a single frame.

Returns
Time in seconds for a single frame

◆ getHeight()

static int com.mygdx.game.engine.Engine.getHeight ( )
static

Returns the real height of the screen

Returns
The height of the screen in pixels

◆ getSceneManager()

static BaseScenesManager com.mygdx.game.engine.Engine.getSceneManager ( )
static

Gets the SceneManager set with the 'setScenesManager' method

Returns
The SceneManager set with the 'setScenesManager' method

◆ getTextureResources()

static BaseTextureResources com.mygdx.game.engine.Engine.getTextureResources ( )
static

Returns the TextureResources instance given in the Engine Constructor

Returns
TextureResources instance given in the Engine Constructor

◆ getTitle()

static String com.mygdx.game.engine.Engine.getTitle ( )
static

Returns the Title of the application given to the Engine

Returns
The title of the application as String

◆ getWidth()

static int com.mygdx.game.engine.Engine.getWidth ( )
static

Returns the real width of the screen

Returns
The width of the screen in pixels

◆ setScenesManager()

void com.mygdx.game.engine.Engine.setScenesManager ( BaseScenesManager  manager)

Sets the scene manager of the Engine.

Parameters
manageris the Scene Manager which should be put as static scene manager.

◆ update()

void com.mygdx.game.engine.Engine.update ( )

Updates the entire Engine with all the rendering and scene managing

Member Data Documentation

◆ TimeScale

float com.mygdx.game.engine.Engine.TimeScale = 1f
static

The scale on which the game is running. (This will effect all game Delta Time) [DEFAULT VALUE: 1f]


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