|
Drag[en]gine Script Module DragonScript 1.35
|
Base class for game applications. More...
Classes | |
| class | CollisionFilterBit |
| Collision filter bits. More... | |
| interface | DefaultBindingUpdater |
| Default binding updater interface. More... | |
| class | WorldLayerBit |
| Layer masks. More... | |
Public Member Functions | |
| void | addBehavior (GABehavior behavior) |
| Add behavior. | |
| void | addDefaultBindingUpdater (DefaultBindingUpdater updater) |
| Add default binding updater. | |
| void | cancelLoadGameWorld () |
| Cancel loading game world. | |
| Array | collectBehaviors (Block ablock) |
| Collect behaviors with block into Array. | |
| BaseGameServices | createBaseGameServices () |
| Create base game services. | |
| ConnectionTracker | createConnectionTracker () |
| Create connection tracker. | |
| BaseConversationPlayback | createConversationPlayback (Conversation conversation) |
| Create conversation playback. | |
| InputProcessor | createInputProcessorBindings () |
| Create input processor to forward events to binding manager. | |
| InputProcessor | createInputProcessorDesktop () |
| Create input processor to forward events to desktop widget. | |
| NetworkStateTracker | createNetworkStateTracker () |
| Create network state tracker. | |
| PanelHud | createPanelHud () |
| Create game world hud panel. | |
| ScreenshotCreator | createScreenshotCreator () |
| Create screen shot creater. | |
| SimpleConversationConverter | createSimpleConversationConverter () |
| Create simple conversation converter. | |
| SkinAnnotations | createSkinAnnotations () |
| Create skin annotations. | |
| TranslationManager | createTranslationManager () |
| Create translation manager. | |
| TSTriggerTable | createTriggerTable () |
| Create trigger table. | |
| WindowConsole | createWindowConsole () |
| Create console window. | |
| WindowPlayerChoice | createWindowPlayerChoice () |
| Create player choice window. | |
| WindowSubTitle | createWindowSubTitle () |
| Create sub title window. | |
| DefaultBindingHelper | defaultBindings () |
| Create default bindings. | |
| void | desktopLoadGuiTheme (String filename) |
| Load gui theme and assign it to desktop widget. | |
| GABehavior | findBehavior (Block ablock) |
| Find behavior with block. | |
| void | finishLoadGameWorld () |
| Finish loading game world. | |
| void | forEachBehavior (Block ablock) |
| Visit behaviors with block. | |
| AttachableBehaviorFactoryList | getAttachableBehaviorFactories () |
| Attachable behavior factories. | |
| BaseGameServices | getBaseGameServices () |
| Base game services. | |
| GABehavior | getBehaviorAt (int index) |
| Behavior at index. | |
| int | getBehaviorCount () |
| Count of behaviors. | |
| BehaviorFactoryList | getBehaviorFactories () |
| Behavior factories. | |
| BindingManager | getBindingManager () |
| Binding manager. | |
| Dictionary | getCollisionFilterMap () |
| Collision filter map. | |
| CommandManager | getCommandManager () |
| Command Manager. | |
| ParameterTree | getConfiguration () |
| Game configuration. | |
| ConnectionTracker | getConnectionTracker () |
| Connection tracker. | |
| Console | getConsole () |
| Console object. | |
| ConsoleCommandList | getConsoleCommands () |
| Console command list. | |
| Desktop | getDesktop () |
| Desktop widget. | |
| ElementClassList | getElementClassList () |
| Element classes list. | |
| GameWorldLoader | getGameWorldLoader () |
| Game world loader or null. | |
| GlobalEvents | getGlobalEvents () |
| Global event manager. | |
| GWBehaviorFactoryList | getGWBehaviorFactories () |
| Game world behavior factories. | |
| MutableID | getIDGenerator () |
| ID Generator. | |
| InputProcessor | getInputProcessor () |
| Input Processor. | |
| bool | getInverseLookVertical () |
| Invert looking up-down. | |
| Loaders | getLoaders () |
| Loaders. | |
| float | getMouseSensitivity () |
| Mouse sensitivity. | |
| NetworkStateTracker | getNetworkStateTracker () |
| Network state tracker. | |
| PanelHud | getPanelHud () |
| Game world HUD panel or null. | |
| ECBehaviorPlayerControllable.Tracker | getPlayerControlledActor () |
| Player controlled actor tracker. | |
| ScreenshotCreator | getScreenshotCreator () |
| Screenshot creator. | |
| ParameterTree | getSettings () |
| Saved settings. | |
| SimpleConversationConverter | getSimpleConversationConverter () |
| Simple conversation converter. | |
| SkinAnnotations | getSkinAnnotations () |
| Skin annotations. | |
| TranslationManager | getTranslationManager () |
| Translation manager. | |
| TSTriggerTable | getTriggerTable () |
| Trigger table. | |
| WindowConsole | getWindowConsole () |
| Console window toggled using CommandToggleConsole or null if absent. | |
| WindowGameWorld | getWindowGameWorld () |
| Game world window or null. | |
| WindowPlayerChoice | getWindowPlayerChoice () |
| PlayerChoice window or null if absent. | |
| Dictionary | getWorldLayerMap () |
| World layer map. | |
| void | initGame () |
| Called by game engine to init game. | |
| void | initSettings () |
| Init settings with default values. | |
| BaseGameApp | new () |
| Create game application. | |
| void | onAppActivate () |
| Called after the application received or lost focus. | |
| void | quitGame () |
| Quit game. | |
| void | removeDefaultBindingUpdater (DefaultBindingUpdater updater) |
| Remove default binding updater. | |
| void | saveBindings () |
| Save bindings to the bindings file. | |
| void | saveSettings () |
| Save settings to the settings file. | |
| void | setDesktop (Desktop desktop) |
| Set desktop widget. | |
| void | setInputProcessor (InputProcessor inputProcessor) |
| Set input processor. | |
| void | setInputProcessorBindings () |
| Set input processor to forward events to binding manager. | |
| void | setInputProcessorDesktop () |
| Set input processor to forward events to desktop widget. | |
| void | setInputProcessorNothing () |
| Set input processor to nothing. | |
| void | setInverseLookVertical (bool inverseLookVertical) |
| Set if looking up-down is inverted. | |
| void | setMouseSensitivity (float sensitivity) |
| Set mouse sensitivity. | |
| void | setPanelHud (PanelHud panel) |
| Set game world HUD panel or null. | |
| void | setWindowConsole (WindowConsole window) |
| Set console window toggled using CommandToggleConsole or null if absent. | |
| void | setWindowGameWorld (WindowGameWorld window) |
| Set game world window or null. | |
| void | setWindowPlayerChoice (WindowPlayerChoice window) |
| Set player choice window or null if absent. | |
| void | startLoadGameWorld (GameWorldLoader loader) |
| Start loading game world. | |
| Public Member Functions inherited from Dragengine.Game | |
| void | cleanUp () |
| Called by the game engine to clean up before the game exits. | |
| void | inputEvent (InputEvent event) |
| Process input event. | |
| void | userRequestedQuit () |
| User requested window to be closed. | |
| void | onFrameUpdate () |
| Called by the game engine at the beginning of each frame update. | |
| void | onResizeRenderWindow () |
| Size of the render window changed. | |
| int | getArgumentCount () |
| Number of command line arguments given to the game. | |
| String | getArgumentAt (int index) |
| Command line argument given to the game. | |
| String | getRestartInfo () |
| Information passed to Engine.restart(String) before restarting. | |
Static Public Member Functions | |
| static BaseGameApp | getApp () |
| The one and only application object. | |
Static Public Attributes | |
| static final String | defaultPathGuiTheme = "/shareddata/guithemes/modern/modern.degt" |
| Path of default gui theme provided by the DragonScript module. | |
| static String | eventDeviceAttachedDetached = "deviceAttachedDetached" |
| Global event send if input devices have been attached or detached. | |
| static String | eventDeviceParamsChanged = "deviceParamsChanged" |
| Global event send if input device parameters have changed. | |
| static BaseGameApp | pApp = null |
| static final String | settingInputInvertLookVertical = "input.invertLookVertical" |
| Invert looking up-down setting key. | |
| static final String | settingInputMouseSensitivity = "input/mouseSensitivity" |
| Mouse sensitivity. | |
Protected Member Functions | |
| void | autoInitBaseGameServices () |
| Auto initialize base game services. | |
| void | createAndAddAttachableBehaviorFactories () |
| Create attachable behavior factories adding them to the factory list. | |
| void | createAndAddBehaviorFactories () |
| Create behavior factories adding them to the factory list. | |
| void | createAndAddConsoleCommands () |
| Create console commands and add them to console command list. | |
| void | createAndAddCoreCommands () |
| Create core commands and add them to command list. | |
| void | createAndAddElementClasses () |
| Create element classes and add them to element class list. | |
| void | createAndAddGWBehaviorFactories () |
| Create game world behavior factories adding them to the factory list. | |
| void | createAndSetDesktop () |
| Create and set desktop. | |
| void | createAppBehaviors () |
| Create application behaviors. | |
| void | initCollisionFilterMap () |
| Initialize collision filter map entries. | |
| void | initLanguages () |
| Load language packs and select active language pack. | |
| void | initWorldLayerMap () |
| Initialize world layer map entries. | |
| void | loadBindings () |
| Load bindings from saved configuration or create default bindings. | |
| void | loadConfiguration () |
| Load configuration from parameter tree XML file if present. | |
| void | loadSettings () |
| Load settings from saved settings or set default settings. | |
| void | loadXmlElementClasses () |
| Create element classes from XML files and add them to element class list. | |
| void | registerPersistencyFactories () |
| Register persistency factories. | |
| Protected Member Functions inherited from Dragengine.Game | |
Base class for game applications.
Basic implementation for game applications to use as super class. Provides various objects typically required to create a game with. This superclass can be used for 3D and 2D oriented projects alike. This class implements management logic but no game logic in any way. A typical subclass implementation looks like this:
This initializes the game and starts loading a game world. Once the loading finishes the control is handed over to the player. Instead of directly loading the game a main menu can be shown instead in initGame() which then does the game loading in time.
This class is designed to be used as singleton. Use the getApp() method everywhere to obtain the one and only game application instance.
| void Dragengine.BaseGameApp.addBehavior | ( | GABehavior | behavior | ) |
Add behavior.
References quitGame(), and Dragengine.Game.userRequestedQuit().
Referenced by finishLoadGameWorld().
| void Dragengine.BaseGameApp.addDefaultBindingUpdater | ( | DefaultBindingUpdater | updater | ) |
Add default binding updater.
References getConfiguration(), getSettings(), and pConfiguration.
Referenced by createConversationPlayback().
|
protected |
Auto initialize base game services.
Automatically initialize services not requiring user intervention. The default implementation calls BaseGameServices#autoInitServices().
References getAttachableBehaviorFactories(), getElementClassList(), getGWBehaviorFactories(), pAttachableBehaviorFactories, pElementClassList, and pGWBehaviorFactories.
Referenced by createConversationPlayback(), and getSimpleConversationConverter().
| void Dragengine.BaseGameApp.cancelLoadGameWorld | ( | ) |
Cancel loading game world.
If no game world loader is active this method does nothing. Otherwise cancelLoading() and dispose() is called on the active game world. After this call returns no game world loader is active.
References getBehaviorAt(), and pBehaviors.
Referenced by createConversationPlayback(), and getWindowConsole().
| Array Dragengine.BaseGameApp.collectBehaviors | ( | Block | ablock | ) |
Collect behaviors with block into Array.
Block is required to have one parameter GABehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
References getApp(), and pApp.
Referenced by createConversationPlayback().
|
protected |
Create attachable behavior factories adding them to the factory list.
getAttachableBehaviorFactories() is used by GenericBehaviorElementClass to set the initial list of allowed factories. Default uses BehaviorFactoryHelper#addAllAttachableFactories() to populate the list.
Referenced by createConversationPlayback(), and setDesktop().
|
protected |
Create behavior factories adding them to the factory list.
Behavior factories allow generic BehaviorElementClass to be created using XML element class files (*.deeclass) where not only element class properties can be defined but also behaviors added. getBehaviorFactories() is used by GenericBehaviorElementClass to set the initial list of allowed factories. Default uses BehaviorFactoryHelper#addAllFactories() to populate the list.
References pWindowSubTitle.
Referenced by createConversationPlayback(), and setDesktop().
|
protected |
Create console commands and add them to console command list.
Console commands are used by WindowConsole (more precisely the ConsoleInputField inside) to allow players and mostly developers to run actions not supposed to be bound to player input. Default implementation creates and adds these console commands:
References pPanelHud.
Referenced by createConversationPlayback(), and getDesktop().
|
protected |
Create core commands and add them to command list.
Can be used when overriding createAndAddCommands() to add custom commands without needing to remove movement or interaction commands.
Creates and adds these commands:
If WindowConsole is present this command is also added:
References getPanelHud(), pPanelHud, and setPanelHud().
Referenced by createConversationPlayback().
|
protected |
Create element classes and add them to element class list.
Element classes list contains all element classes world files are allowed to be used. Default implementation creates and adds these element classes:
If you do not want one of these classes to be available you can remove them after super-calling createAndAddElementClasses() by using ElementClassList.removeNamed(). Optionally you can not super-call createAndAddElementClasses() to add the element classes above manually according to your needs.
References setWindowGameWorld().
Referenced by createConversationPlayback(), and getAttachableBehaviorFactories().
|
protected |
Create game world behavior factories adding them to the factory list.
References getWindowGameWorld(), getWindowPlayerChoice(), pDesktop, pWindowGameWorld, pWindowPlayerChoice, pWindowSubTitle, and setWindowPlayerChoice().
Referenced by createConversationPlayback(), and getBehaviorFactories().
|
protected |
Create and set desktop.
References getDesktop(), getWorldLayerMap(), and pDesktop.
Referenced by createConversationPlayback(), and getDesktop().
|
protected |
Create application behaviors.
References getInputProcessor(), pInputProcessor, pPanelHud, and pWindowGameWorld.
Referenced by createConversationPlayback(), and getBehaviorFactories().
| BaseGameServices Dragengine.BaseGameApp.createBaseGameServices | ( | ) |
Create base game services.
Creates instance of BaseGameServices.
References getBehaviorFactories(), and pBehaviorFactories.
Referenced by createConversationPlayback(), and getSimpleConversationConverter().
| ConnectionTracker Dragengine.BaseGameApp.createConnectionTracker | ( | ) |
Create connection tracker.
Creates instance of ConnectionTracker.
References pCommandManager, and pWindowConsole.
Referenced by createConversationPlayback(), and getCollisionFilterMap().
| BaseConversationPlayback Dragengine.BaseGameApp.createConversationPlayback | ( | Conversation | conversation | ) |
Create conversation playback.
Create instance of BaseConversationPlayback. Overwrite to create playback supporting game specific features like obtaining conversation actors and coordinate system by identifier and running game commands and conditions.
For many game projects the base BaseConversationPlayback implementation is enough with game specific behavior defined by adding game commands and game conditions. This example shows a typical subclass implementation for this common scenario.
Where PlayerGameCommand implements BaseConversationPlayback.ConversationCommand and PlayerGameCondition implements BaseConversationPlayback.ConversationCondition. Conversation scripts can then use "player arg1 arg2 ... argN" game command and game condition with the classes above receiving the command conveniently as Array of String.
Any number of commands and conditions can be added easily this way without needing to subclass BaseConversationPlayback.
References addDefaultBindingUpdater(), autoInitBaseGameServices(), cancelLoadGameWorld(), collectBehaviors(), createAndAddAttachableBehaviorFactories(), createAndAddBehaviorFactories(), createAndAddConsoleCommands(), createAndAddCoreCommands(), createAndAddElementClasses(), createAndAddGWBehaviorFactories(), createAndSetDesktop(), createAppBehaviors(), createBaseGameServices(), createConnectionTracker(), createConversationPlayback(), createNetworkStateTracker(), createPanelHud(), createScreenshotCreator(), createSimpleConversationConverter(), createSkinAnnotations(), createTranslationManager(), createTriggerTable(), createWindowConsole(), createWindowPlayerChoice(), createWindowSubTitle(), defaultBindings(), defaultLanguagePackName, findBehavior(), finishLoadGameWorld(), getBaseGameServices(), getGameWorldLoader(), getLoaders(), initCollisionFilterMap(), initLanguages(), initSettings(), initWorldLayerMap(), loadBindings(), loadConfiguration(), loadSettings(), loadXmlElementClasses(), new(), pathConfiguration, pBaseGameServices, pBehaviors, pCollisionFilterMap, pCommandManager, pConfiguration, pConsole, pConsoleCommands, pDefaultBindingUpdaters, pElementClassList, pGameWorldLoader, pLoaders, pTranslationManager, pWindowConsole, registerPersistencyFactories(), removeDefaultBindingUpdater(), saveBindings(), saveSettings(), setDesktop(), setInverseLookVertical(), and startLoadGameWorld().
Referenced by createConversationPlayback().
| InputProcessor Dragengine.BaseGameApp.createInputProcessorBindings | ( | ) |
Create input processor to forward events to binding manager.
Referenced by initSettings().
| InputProcessor Dragengine.BaseGameApp.createInputProcessorDesktop | ( | ) |
Create input processor to forward events to desktop widget.
References pApp, and pTranslationManager.
Referenced by initSettings().
| NetworkStateTracker Dragengine.BaseGameApp.createNetworkStateTracker | ( | ) |
Create network state tracker.
Creates instance of NetworkStateTracker.
References pWindowConsole.
Referenced by createConversationPlayback(), and getCollisionFilterMap().
| PanelHud Dragengine.BaseGameApp.createPanelHud | ( | ) |
Create game world hud panel.
Default implementation creates an instance of PanelHud. Subclass can return null to not use a game world hud panel or changing parameters.
References getBindingManager(), getConsoleCommands(), pBindingManager, and pConsoleCommands.
Referenced by createConversationPlayback().
| ScreenshotCreator Dragengine.BaseGameApp.createScreenshotCreator | ( | ) |
Create screen shot creater.
Creates instance of ScreenshotCreator and assigns console.
References pCommandManager, and pDesktop.
Referenced by createConversationPlayback(), and getWorldLayerMap().
| SimpleConversationConverter Dragengine.BaseGameApp.createSimpleConversationConverter | ( | ) |
Create simple conversation converter.
Creates instance of SimpleConversationConverter.
References pDesktop.
Referenced by createConversationPlayback(), and getLoaders().
| SkinAnnotations Dragengine.BaseGameApp.createSkinAnnotations | ( | ) |
Create skin annotations.
Creates instance of SkinAnnotations. Subclass can overwrite to load skin annotations into the newly created object like this:
See LoadSkinAnnotations.loadFromFiles for details about the ".deskinann" files.
References setWindowConsole().
Referenced by createConversationPlayback(), and getCollisionFilterMap().
| TranslationManager Dragengine.BaseGameApp.createTranslationManager | ( | ) |
Create translation manager.
Creates instance of TranslationManager.
References new(), pDesktop, and setDesktop().
Referenced by createConversationPlayback(), and getConsole().
| TSTriggerTable Dragengine.BaseGameApp.createTriggerTable | ( | ) |
Create trigger table.
Creates instance of TSTriggerTable.
References getGlobalEvents(), getIDGenerator(), getWindowConsole(), pGlobalEvents, pIDGenerator, and pWindowConsole.
Referenced by createConversationPlayback(), and getCollisionFilterMap().
| WindowConsole Dragengine.BaseGameApp.createWindowConsole | ( | ) |
Create console window.
Default implementation creates an instance of WinowConsole and assigns getConsole(). Subclass can return null to not use a console window.
References getScreenshotCreator(), getTriggerTable(), pScreenshotCreator, and pTriggerTable.
Referenced by createConversationPlayback().
| WindowPlayerChoice Dragengine.BaseGameApp.createWindowPlayerChoice | ( | ) |
Create player choice window.
Default implementation creates an instance of WindowPlayerChoice. Subclass can return null to not use a player choise window. For conversations to work an instance implementing the conversation player choice interface is required. WindowPlayerChoice does fulfill this requirement.
References getNetworkStateTracker(), and pNetworkStateTracker.
Referenced by createConversationPlayback().
| WindowSubTitle Dragengine.BaseGameApp.createWindowSubTitle | ( | ) |
Create sub title window.
Default implementation creates an instance of WindowSubTitle. Subclass can return null to not use a subtitle window. For conversations to work an instance implementing the conversation subtitle interface is required. WindowSubTitle does fulfill this requirement.
References getConnectionTracker(), getSkinAnnotations(), pConnectionTracker, and pSkinAnnotations.
Referenced by createConversationPlayback().
| DefaultBindingHelper Dragengine.BaseGameApp.defaultBindings | ( | ) |
Create default bindings.
Default implementation creates instance of DefaultBindingHelper with these bindings:
If WindowConsole is present these additional bindings are added:
If any of these commands are not present no binding is added form them.
Typical subclass implementation can look like this:
References setInverseLookVertical().
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.desktopLoadGuiTheme | ( | String | filename | ) |
Load gui theme and assign it to desktop widget.
References Dragengine.Game.inputEvent(), and pBindingManager.
Referenced by loadBindings().
| GABehavior Dragengine.BaseGameApp.findBehavior | ( | Block | ablock | ) |
Find behavior with block.
Block is required to have one parameter GABehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
References quitGame().
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.finishLoadGameWorld | ( | ) |
Finish loading game world.
If no game world loader is active this method does nothing. Otherwise calls dispose() on the active game world. After this call returns no game world loader is active.
References addBehavior(), forEachBehavior(), new(), and pBehaviors.
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.forEachBehavior | ( | Block | ablock | ) |
Visit behaviors with block.
Block is required to have one parameter of type GABehavior or subclass thereof. Block is called only for behaviors castable to block parameter type.
Referenced by finishLoadGameWorld().
|
static |
The one and only application object.
References initGame(), new(), pApp, and pIDGenerator.
Referenced by collectBehaviors().
| AttachableBehaviorFactoryList Dragengine.BaseGameApp.getAttachableBehaviorFactories | ( | ) |
Attachable behavior factories.
References createAndAddElementClasses(), new(), pElementClassList, and pLoaders.
Referenced by autoInitBaseGameServices().
| BaseGameServices Dragengine.BaseGameApp.getBaseGameServices | ( | ) |
| GABehavior Dragengine.BaseGameApp.getBehaviorAt | ( | int | index | ) |
Behavior at index.
References onAppActivate(), and pBehaviors.
Referenced by cancelLoadGameWorld().
| int Dragengine.BaseGameApp.getBehaviorCount | ( | ) |
Count of behaviors.
References Dragengine.Game.onResizeRenderWindow(), and pDesktop.
Referenced by startLoadGameWorld().
| BehaviorFactoryList Dragengine.BaseGameApp.getBehaviorFactories | ( | ) |
Behavior factories.
References createAndAddGWBehaviorFactories(), createAppBehaviors(), new(), pBehaviors, and pGWBehaviorFactories.
Referenced by createBaseGameServices().
| BindingManager Dragengine.BaseGameApp.getBindingManager | ( | ) |
Binding manager.
Referenced by createPanelHud().
| Dictionary Dragengine.BaseGameApp.getCollisionFilterMap | ( | ) |
Collision filter map.
Returns Dictionary mapping String filter names to int filter bits. Used by ECPCollisionFilter and other element class properties to allow defining collision filters using well defined names.
References createConnectionTracker(), createNetworkStateTracker(), createSkinAnnotations(), createTriggerTable(), initCollisionFilterMap(), initWorldLayerMap(), pConnectionTracker, pLoaders, pNetworkStateTracker, pSkinAnnotations, and pTriggerTable.
Referenced by initCollisionFilterMap().
| CommandManager Dragengine.BaseGameApp.getCommandManager | ( | ) |
| ParameterTree Dragengine.BaseGameApp.getConfiguration | ( | ) |
Game configuration.
References new(), pConsole, and pGlobalEvents.
Referenced by addDefaultBindingUpdater().
| ConnectionTracker Dragengine.BaseGameApp.getConnectionTracker | ( | ) |
| Console Dragengine.BaseGameApp.getConsole | ( | ) |
Console object.
References createTranslationManager(), new(), pPlayerControlledActor, and pTranslationManager.
Referenced by removeDefaultBindingUpdater().
| ConsoleCommandList Dragengine.BaseGameApp.getConsoleCommands | ( | ) |
| Desktop Dragengine.BaseGameApp.getDesktop | ( | ) |
Desktop widget.
References createAndAddConsoleCommands(), createAndSetDesktop(), new(), pBindingManager, pWindowGameWorld, setInputProcessorDesktop(), setPanelHud(), and setWindowGameWorld().
Referenced by createAndSetDesktop(), and Dragengine.TestSystem.TestGameApp.initGame().
| ElementClassList Dragengine.BaseGameApp.getElementClassList | ( | ) |
| GameWorldLoader Dragengine.BaseGameApp.getGameWorldLoader | ( | ) |
Game world loader or null.
References setMouseSensitivity().
Referenced by createConversationPlayback().
| GlobalEvents Dragengine.BaseGameApp.getGlobalEvents | ( | ) |
Global event manager.
References pAttachableBehaviorFactories, pBehaviorFactories, and pGWBehaviorFactories.
Referenced by createTriggerTable().
| GWBehaviorFactoryList Dragengine.BaseGameApp.getGWBehaviorFactories | ( | ) |
Game world behavior factories.
References loadBindings(), and pBindingManager.
Referenced by autoInitBaseGameServices().
| MutableID Dragengine.BaseGameApp.getIDGenerator | ( | ) |
| InputProcessor Dragengine.BaseGameApp.getInputProcessor | ( | ) |
Input Processor.
References pBaseGameServices, and pDefaultBindingUpdaters.
Referenced by createAppBehaviors().
| bool Dragengine.BaseGameApp.getInverseLookVertical | ( | ) |
Invert looking up-down.
References Dragengine.Game.inputEvent(), pGlobalEvents, and pInputProcessor.
Referenced by loadBindings().
| Loaders Dragengine.BaseGameApp.getLoaders | ( | ) |
References createSimpleConversationConverter(), new(), pCollisionFilterMap, and pSimpleConversationConverter.
Referenced by createConversationPlayback(), and loadConfiguration().
| float Dragengine.BaseGameApp.getMouseSensitivity | ( | ) |
Mouse sensitivity.
References Dragengine.Game.onFrameUpdate(), and pScreenshotCreator.
Referenced by saveBindings().
| NetworkStateTracker Dragengine.BaseGameApp.getNetworkStateTracker | ( | ) |
| PanelHud Dragengine.BaseGameApp.getPanelHud | ( | ) |
Game world HUD panel or null.
References pConnectionTracker, pNetworkStateTracker, and pTriggerTable.
Referenced by createAndAddCoreCommands().
| ECBehaviorPlayerControllable.Tracker Dragengine.BaseGameApp.getPlayerControlledActor | ( | ) |
| ScreenshotCreator Dragengine.BaseGameApp.getScreenshotCreator | ( | ) |
Screenshot creator.
Referenced by createWindowConsole().
| ParameterTree Dragengine.BaseGameApp.getSettings | ( | ) |
Saved settings.
References new(), pConfiguration, pConsole, and pLoaders.
Referenced by addDefaultBindingUpdater().
| SimpleConversationConverter Dragengine.BaseGameApp.getSimpleConversationConverter | ( | ) |
Simple conversation converter.
References autoInitBaseGameServices(), createBaseGameServices(), initLanguages(), loadSettings(), new(), pBaseGameServices, and registerPersistencyFactories().
Referenced by loadConfiguration().
| SkinAnnotations Dragengine.BaseGameApp.getSkinAnnotations | ( | ) |
Skin annotations.
References Dragengine.Game.cleanUp(), and pBehaviors.
Referenced by createWindowSubTitle().
| TranslationManager Dragengine.BaseGameApp.getTranslationManager | ( | ) |
Translation manager.
References loadConfiguration(), new(), and pDefaultBindingUpdaters.
Referenced by loadConfiguration().
| TSTriggerTable Dragengine.BaseGameApp.getTriggerTable | ( | ) |
Trigger table.
Referenced by createWindowConsole().
| WindowConsole Dragengine.BaseGameApp.getWindowConsole | ( | ) |
Console window toggled using CommandToggleConsole or null if absent.
References cancelLoadGameWorld(), pGameWorldLoader, pPlayerControlledActor, pWindowConsole, pWindowPlayerChoice, and pWindowSubTitle.
Referenced by createTriggerTable().
| WindowGameWorld Dragengine.BaseGameApp.getWindowGameWorld | ( | ) |
Game world window or null.
References pDesktop, and pInputProcessor.
Referenced by createAndAddGWBehaviorFactories().
| WindowPlayerChoice Dragengine.BaseGameApp.getWindowPlayerChoice | ( | ) |
PlayerChoice window or null if absent.
References pBindingManager, and pCommandManager.
Referenced by createAndAddGWBehaviorFactories().
| Dictionary Dragengine.BaseGameApp.getWorldLayerMap | ( | ) |
World layer map.
Returns Dictionary mapping String world layer names to int world layer bits. Used by various element class properties to allow defining world layers using well defined names.
References createScreenshotCreator(), new(), pCommandManager, pConsoleCommands, and pScreenshotCreator.
Referenced by createAndSetDesktop().
|
protected |
Initialize collision filter map entries.
Used by ECPCollisionFilter and other element class properties to allow defining collision filters using well defined names.
Default implementation sets these entries:
| Name | Bit |
|---|---|
| geometry | CollisionFilterBit.geometry |
| dynamic | CollisionFilterBit.dynamic |
| actor | CollisionFilterBit.actor |
| actorAI | CollisionFilterBit.actorAI |
| trigger | CollisionFilterBit.trigger |
| particle | CollisionFilterBit.particle |
| forceField | CollisionFilterBit.forceField |
References getCollisionFilterMap(), and pCollisionFilterMap.
Referenced by createConversationPlayback(), and getCollisionFilterMap().
| void Dragengine.BaseGameApp.initGame | ( | ) |
Called by game engine to init game.
Subclass has to super-call this method first before doing own initialization. Once this super-call returns all object instance provided by this class are created. Initializing the content of the object instances is up to the subclass. This is done either inside subclass initGame() implementation or one of the called hook methods.
After this super-call returns the following is true:
The super-call also invoked these hook methods to do initialization work:
Reimplemented from Dragengine.Game.
Reimplemented in Dragengine.TestSystem.TestGameApp.
Referenced by getApp().
|
protected |
Load language packs and select active language pack.
Default implementation loads language packs from path specified by property pathLanguagePacks if property is not null and path is valid. Activates the language pack with the first matching identifier from the below list:
Sets fallback language pack to active language pack. When changing language pack the fallback language pack stays untouched. This ensures default language translations are shown if the active translation is missing translations.
References getCommandManager(), and pCommandManager.
Referenced by createConversationPlayback(), and getSimpleConversationConverter().
| void Dragengine.BaseGameApp.initSettings | ( | ) |
Init settings with default values.
Set the value of all settings supported by the application. Once saved the players can modify the settings file and knows all possible settings without searching.
References createInputProcessorBindings(), createInputProcessorDesktop(), new(), setInputProcessor(), and setInputProcessorBindings().
Referenced by createConversationPlayback().
|
protected |
Initialize world layer map entries.
Used by ECPLayerMask and other element class properties to allow defining layer masks using well defined names.
| Name | Bit |
|---|---|
| default | WorldLayerBit.default |
| envmap | WorldLayerBit.envmap |
| audio | WorldLayerBit.audio |
Referenced by createConversationPlayback(), and getCollisionFilterMap().
|
protected |
Load bindings from saved configuration or create default bindings.
Loads the saved configuration from pathSavedBindings property. If the saved bindings file is absent or damaged default bindings are created.
If you change bindings call saveBindings() to save the bindings to the saved file. It is best to save changes to the bindings immediately.
Default bindings are not saved automatically. This has two main reasons. First the default bindings can be potentially created because of a damaged binding save file. Not saving them allows the user to quit the game and fix the file manually if desired. Second games not based on bindings should not save a useless binding file.
No implementation in this class calls saveBindings() itself. As long as you do not call saveBindings() on your own no bindings save file will be produced.
References desktopLoadGuiTheme(), getInverseLookVertical(), getPlayerControlledActor(), pDesktop, pPlayerControlledActor, setInputProcessor(), and setInputProcessorNothing().
Referenced by createConversationPlayback(), and getGWBehaviorFactories().
|
protected |
Load configuration from parameter tree XML file if present.
Uses pathConfiguration to located the file.
References getLoaders(), getSimpleConversationConverter(), getTranslationManager(), pLoaders, pSimpleConversationConverter, and pTranslationManager.
Referenced by createConversationPlayback(), and getTranslationManager().
|
protected |
Load settings from saved settings or set default settings.
Loads the saved settings from pathSavedSettings property. If the saved settings file is absent or damaged set default settings and saves the file. Ensures a valid settings file with all known settings is saved to file. This way players can modify the settings file and know all possible settings without needing to search.
If you change settings call saveSettings() to save the settings to the saved file. It is best to save changes to the bindings immediately.
References pDesktop, pInputProcessor, and setInputProcessor().
Referenced by createConversationPlayback(), and getSimpleConversationConverter().
|
protected |
Create element classes from XML files and add them to element class list.
Uses configuration list value "xmlElementClassDirectories" as directories to search recursively for XML element classes (.deeclass).
References pDesktop, pWindowGameWorld, and setPanelHud().
Referenced by createConversationPlayback(), and getCommandManager().
| BaseGameApp Dragengine.BaseGameApp.new | ( | ) |
Create game application.
Empty implementation. All initialization tasks have to be done in the initGame() method call to support proper hook-method calls with custom subclass behavior.
Reimplemented from Dragengine.Game.
Reimplemented in Dragengine.TestSystem.TestGameApp.
References defaultConsoleBufferSize, defaultInputMouseAxisScale, defaultInputMouseWheelScale, defaultLanguagePackIdentifier, defaultLanguagePackName, defaultPathGuiTheme, new(), pathConfiguration, pathDesktopGuiTheme, pathLanguagePacks, pathSavedBindings, and pathSavedSettings.
Referenced by createConversationPlayback(), createTranslationManager(), finishLoadGameWorld(), getApp(), getAttachableBehaviorFactories(), getBehaviorFactories(), getConfiguration(), getConsole(), getDesktop(), getLoaders(), getSettings(), getSimpleConversationConverter(), getTranslationManager(), getWorldLayerMap(), initSettings(), new(), and setDesktop().
| void Dragengine.BaseGameApp.onAppActivate | ( | ) |
Called after the application received or lost focus.
Reimplemented from Dragengine.Game.
Referenced by getBehaviorAt().
| void Dragengine.BaseGameApp.quitGame | ( | ) |
Quit game.
Called by CommandQuitGame or by other scripts. Calls Engine.quit() to quit the game the next time possible. This will call cleanUp(). Make sure no reference loops are present after cleanUp() finishes to allow the Script Module to properly shut down.
Subclass can overwrite to ask user first if he wants to quit and optionally do some additional closing actions. To close the game call Engine.quit() .
Referenced by addBehavior(), and findBehavior().
|
protected |
Register persistency factories.
Persistency factories allow saving and loading object instances implementing the Persistable interface for use with save states or network play. While creating the Loaders instance Loaders.addDefaultPersistencyFactories() adds all persistency factories provided by the DragonScript module. Subclass can implement registerPersistencyFactories() to add game specific persistency factories. Default implementation is empty. Super-calling is not required.
Referenced by createConversationPlayback(), and getSimpleConversationConverter().
| void Dragengine.BaseGameApp.removeDefaultBindingUpdater | ( | DefaultBindingUpdater | updater | ) |
Remove default binding updater.
References getConsole(), and pConsole.
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.saveBindings | ( | ) |
Save bindings to the bindings file.
Uses property pathSavedBindings as file name.
References getMouseSensitivity().
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.saveSettings | ( | ) |
Save settings to the settings file.
Uses property pathSavedSettings as file name. If the file exists already creates first a backup copy with ".backup" appended to pathSavedBindings.
References setInputProcessor(), and setInputProcessorDesktop().
Referenced by createConversationPlayback().
| void Dragengine.BaseGameApp.setDesktop | ( | Desktop | desktop | ) |
Set desktop widget.
Disposes of the old desktop if present and sets the new one. The new desktop is added to the primary canvas making it visible on screen. During resizing events the desktop is adjusted to fit the size to the primary canvas size.
This method does not modify the input processor. To change input processor to send events to the set desktop instance call setInputProcessorDesktop().
References createAndAddAttachableBehaviorFactories(), createAndAddBehaviorFactories(), new(), pAttachableBehaviorFactories, pBehaviorFactories, setWindowConsole(), and setWindowPlayerChoice().
Referenced by createConversationPlayback(), and createTranslationManager().
| void Dragengine.BaseGameApp.setInputProcessor | ( | InputProcessor | inputProcessor | ) |
Set input processor.
References pBaseGameServices.
Referenced by initSettings(), loadBindings(), loadSettings(), and saveSettings().
| void Dragengine.BaseGameApp.setInputProcessorBindings | ( | ) |
Set input processor to forward events to binding manager.
Referenced by initSettings().
| void Dragengine.BaseGameApp.setInputProcessorDesktop | ( | ) |
Set input processor to forward events to desktop widget.
References pConsole, and pSimpleConversationConverter.
Referenced by getDesktop(), and saveSettings().
| void Dragengine.BaseGameApp.setInputProcessorNothing | ( | ) |
Set input processor to nothing.
This is useful in situation where your game transitions from one input situation to another and you do not want to have any user interaction causing disturbances.
Referenced by loadBindings().
| void Dragengine.BaseGameApp.setInverseLookVertical | ( | bool | inverseLookVertical | ) |
Set if looking up-down is inverted.
Call saveSettings() after changing value. Not called automatically.
Referenced by createConversationPlayback(), and defaultBindings().
| void Dragengine.BaseGameApp.setMouseSensitivity | ( | float | sensitivity | ) |
Set mouse sensitivity.
Call saveSettings() after changing value. Not called automatically.
References pBehaviors.
Referenced by getGameWorldLoader().
| void Dragengine.BaseGameApp.setPanelHud | ( | PanelHud | panel | ) |
Set game world HUD panel or null.
Adds the panel to the game world window panel stack if game world window is present and panel has no parent.
References pBindingManager, pGlobalEvents, pLoaders, and pSkinAnnotations.
Referenced by createAndAddCoreCommands(), getDesktop(), and loadXmlElementClasses().
| void Dragengine.BaseGameApp.setWindowConsole | ( | WindowConsole | window | ) |
Set console window toggled using CommandToggleConsole or null if absent.
Assigns the command manager and console commands to the window. Adds the console window to the desktop if it has no parent. If CommandToggleConsole is present assigns the window to the command.
References pPanelHud, and pWindowGameWorld.
Referenced by createSkinAnnotations(), and setDesktop().
| void Dragengine.BaseGameApp.setWindowGameWorld | ( | WindowGameWorld | window | ) |
Set game world window or null.
Clears panel HUD if present. Adds the window to the desktop if it has no parent.
References pTriggerTable.
Referenced by createAndAddElementClasses(), and getDesktop().
| void Dragengine.BaseGameApp.setWindowPlayerChoice | ( | WindowPlayerChoice | window | ) |
Set player choice window or null if absent.
Adds the window to the desktop if it has no parent.
References pConsoleCommands.
Referenced by createAndAddGWBehaviorFactories(), and setDesktop().
| void Dragengine.BaseGameApp.startLoadGameWorld | ( | GameWorldLoader | loader | ) |
Start loading game world.
Calls startLoading() on loader. If this throws an exception cancelLoading() and dispose() is called on loader. Hence you do not have to worry about loader leaking if an exception is thrown.
| EInvalidParam | A game world loader is already active. |
References getBehaviorCount(), and pBehaviors.
Referenced by createConversationPlayback().
| int Dragengine.BaseGameApp.defaultConsoleBufferSize |
| float Dragengine.BaseGameApp.defaultInputMouseAxisScale |
Default binding input processor mouse axis scale factor.
Default value is 0.1.
Referenced by new().
| float Dragengine.BaseGameApp.defaultInputMouseWheelScale |
Default binding input processor mouse wheel scale factor.
Default value is 0.2.
Referenced by new().
| String Dragengine.BaseGameApp.defaultLanguagePackIdentifier |
Name of default language pack to activate.
Default value is the current user locale language at the start of the game. If no such language pack is found internationalization is disabled.
Referenced by new().
| UnicodeString Dragengine.BaseGameApp.defaultLanguagePackName |
Name of default language pack to activate.
Default value is "English". If no such language pack is found internationalization is disabled. The language pack name is matched case sensitive.
Referenced by createConversationPlayback(), and new().
|
static |
Path of default gui theme provided by the DragonScript module.
Referenced by new().
|
static |
Global event send if input devices have been attached or detached.
The event receives no additional data. The event is send by inputEvent() before processing the original InputEvent.
|
static |
Global event send if input device parameters have changed.
The event receives no additional data. The event is send by inputEvent() before processing the original InputEvent.
|
static |
Referenced by collectBehaviors(), createInputProcessorDesktop(), and getApp().
| String Dragengine.BaseGameApp.pathConfiguration |
Configuration file path property.
Default value is "/configuration.dept". Change this property before initGame is called if the configuration parameter tree file is located in a different place.
Using a configuration parameter tree file is optional. If the file is not present it is not loaded. Can also be set to null in this case.
If the configuration file is present and values exist matching properties defined in this class the configuration file values take precendence. This allows to modify the properties without having to change source files.
Referenced by createConversationPlayback(), and new().
| String Dragengine.BaseGameApp.pathDesktopGuiTheme |
| String Dragengine.BaseGameApp.pathLanguagePacks |
Path to directory containing language packs.
Default value is null. To support internationalization in your game set the property to a valid path. Also set default language property if required.
Referenced by new().
| String Dragengine.BaseGameApp.pathSavedBindings |
| String Dragengine.BaseGameApp.pathSavedSettings |
Application settings file path property.
Default value is "/config/settings.dept". "/config" has to match the "Config Path" set in the game project.
Referenced by new().
| AttachableBehaviorFactoryList Dragengine.BaseGameApp.pAttachableBehaviorFactories |
Referenced by autoInitBaseGameServices(), getGlobalEvents(), and setDesktop().
| BaseGameServices Dragengine.BaseGameApp.pBaseGameServices |
Referenced by createConversationPlayback(), getInputProcessor(), getSimpleConversationConverter(), and setInputProcessor().
| BehaviorFactoryList Dragengine.BaseGameApp.pBehaviorFactories |
Referenced by createBaseGameServices(), getGlobalEvents(), and setDesktop().
| Array Dragengine.BaseGameApp.pBehaviors |
| BindingManager Dragengine.BaseGameApp.pBindingManager |
Referenced by createPanelHud(), desktopLoadGuiTheme(), getDesktop(), getGWBehaviorFactories(), getWindowPlayerChoice(), and setPanelHud().
| Dictionary Dragengine.BaseGameApp.pCollisionFilterMap |
Referenced by createConversationPlayback(), getLoaders(), and initCollisionFilterMap().
| CommandManager Dragengine.BaseGameApp.pCommandManager |
| ParameterTree Dragengine.BaseGameApp.pConfiguration |
Referenced by addDefaultBindingUpdater(), createConversationPlayback(), and getSettings().
| ConnectionTracker Dragengine.BaseGameApp.pConnectionTracker |
Referenced by createWindowSubTitle(), getCollisionFilterMap(), and getPanelHud().
| Console Dragengine.BaseGameApp.pConsole |
| ConsoleCommandList Dragengine.BaseGameApp.pConsoleCommands |
Referenced by createConversationPlayback(), createPanelHud(), getWorldLayerMap(), and setWindowPlayerChoice().
| SafeArray Dragengine.BaseGameApp.pDefaultBindingUpdaters |
Referenced by createConversationPlayback(), getInputProcessor(), and getTranslationManager().
| Desktop Dragengine.BaseGameApp.pDesktop |
| ElementClassList Dragengine.BaseGameApp.pElementClassList |
| GameWorldLoader Dragengine.BaseGameApp.pGameWorldLoader |
Referenced by createConversationPlayback(), and getWindowConsole().
| GlobalEvents Dragengine.BaseGameApp.pGlobalEvents |
Referenced by createTriggerTable(), getConfiguration(), getInverseLookVertical(), getPlayerControlledActor(), and setPanelHud().
| GWBehaviorFactoryList Dragengine.BaseGameApp.pGWBehaviorFactories |
Referenced by autoInitBaseGameServices(), getBehaviorFactories(), and getGlobalEvents().
| MutableID Dragengine.BaseGameApp.pIDGenerator |
Referenced by createTriggerTable(), and getApp().
| InputProcessor Dragengine.BaseGameApp.pInputProcessor |
Referenced by createAppBehaviors(), getInverseLookVertical(), getWindowGameWorld(), and loadSettings().
| Loaders Dragengine.BaseGameApp.pLoaders |
| NetworkStateTracker Dragengine.BaseGameApp.pNetworkStateTracker |
Referenced by createWindowPlayerChoice(), getCollisionFilterMap(), and getPanelHud().
| PanelHud Dragengine.BaseGameApp.pPanelHud |
Referenced by createAndAddConsoleCommands(), createAndAddCoreCommands(), createAppBehaviors(), and setWindowConsole().
| ECBehaviorPlayerControllable.Tracker Dragengine.BaseGameApp.pPlayerControlledActor |
Referenced by getConsole(), getWindowConsole(), and loadBindings().
| ScreenshotCreator Dragengine.BaseGameApp.pScreenshotCreator |
Referenced by createWindowConsole(), getMouseSensitivity(), getNetworkStateTracker(), and getWorldLayerMap().
| SimpleConversationConverter Dragengine.BaseGameApp.pSimpleConversationConverter |
Referenced by getLoaders(), loadConfiguration(), and setInputProcessorDesktop().
| SkinAnnotations Dragengine.BaseGameApp.pSkinAnnotations |
Referenced by createWindowSubTitle(), getCollisionFilterMap(), and setPanelHud().
| TranslationManager Dragengine.BaseGameApp.pTranslationManager |
Referenced by createConversationPlayback(), createInputProcessorDesktop(), getConsole(), and loadConfiguration().
| TSTriggerTable Dragengine.BaseGameApp.pTriggerTable |
Referenced by createWindowConsole(), getCollisionFilterMap(), getPanelHud(), and setWindowGameWorld().
| WindowConsole Dragengine.BaseGameApp.pWindowConsole |
| WindowGameWorld Dragengine.BaseGameApp.pWindowGameWorld |
Referenced by createAndAddGWBehaviorFactories(), createAppBehaviors(), getDesktop(), loadXmlElementClasses(), and setWindowConsole().
| WindowPlayerChoice Dragengine.BaseGameApp.pWindowPlayerChoice |
Referenced by createAndAddGWBehaviorFactories(), and getWindowConsole().
| WindowSubTitle Dragengine.BaseGameApp.pWindowSubTitle |
Referenced by createAndAddBehaviorFactories(), createAndAddGWBehaviorFactories(), and getWindowConsole().
|
static |
Invert looking up-down setting key.
|
static |
Mouse sensitivity.