Module GameEngine :: Class GameEngine
[hide private]
[frames] | no frames]

Class GameEngine

source code

Engine.Engine --+
                |
               GameEngine

The main game engine.

Instance Methods [hide private]
 
__init__(self, config='')
Constructor.
source code
 
setStartupLayer(self, startupLayer)
Set the Layer that will be shown when the all the resources have been loaded.
source code
 
isDebugModeEnabled(self) source code
 
setDebugModeEnabled(self, enabled)
Show or hide the debug layer.
source code
 
toggleFullscreen(self)
Toggle between fullscreen and windowed mode.
source code
 
restart(self)
Restart the game.
source code
 
resizeScreen(self, width, height)
Resize the game screen.
source code
 
isServerRunning(self) source code
 
startServer(self)
Start the game server.
source code
 
connect(self, host)
Connect to a game server.
source code
 
stopServer(self)
Stop the game server.
source code
 
disconnect(self, session)
Disconnect a Session
source code
 
loadSvgDrawing(self, target, name, fileName, textureSize='')
Load an SVG drawing synchronously.
source code
 
loading(self)
Loading state loop.
source code
 
clearScreen(self) source code
 
main(self)
Main state loop.
source code
 
run(self)
Run one cycle of the task scheduler engine.
source code

Inherited from Engine.Engine: addTask, boostBackgroundThreads, collectGarbage, enableGarbageCollection, pauseTask, quit, removeTask, resumeTask

Inherited from Engine.Engine (private): _getTaskQueues, _runTask

Method Details [hide private]

__init__(self, config='')
(Constructor)

source code 
Constructor.
Parameters:
  • config - Config instance for settings
Overrides: Engine.Engine.__init__

setStartupLayer(self, startupLayer)

source code 
Set the Layer that will be shown when the all the resources have been loaded. See Data
Parameters:
  • startupLayer - Startup Layer

setDebugModeEnabled(self, enabled)

source code 
Show or hide the debug layer.

toggleFullscreen(self)

source code 
Toggle between fullscreen and windowed mode.
Returns:
True on success

resizeScreen(self, width, height)

source code 
Resize the game screen.
Parameters:
  • width - New width in pixels
  • height - New height in pixels

connect(self, host)

source code 
Connect to a game server.
Parameters:
  • host - Name of host to connect to
Returns:
Session connected to remote server

disconnect(self, session)

source code 

Disconnect a Session

param session: Session to disconnect

loadSvgDrawing(self, target, name, fileName, textureSize='')

source code 

Load an SVG drawing synchronously.

@param target:      An object that will own the drawing
@param name:        The name of the attribute the drawing will be assigned to
@param fileName:    The name of the file in the data directory
@param textureSize  Either None or (x, y), in which case the file will
                    be rendered to an x by y texture
@return:            L{SvgDrawing} instance

run(self)

source code 
Run one cycle of the task scheduler engine.
Overrides: Engine.Engine.run
(inherited documentation)