Game QML Type
The root element containing one or more Scene. More...
Import Statement: | import Bacon2D 1.0 |
Properties
- currentScene : Scene
- gameName : string
- gameState : Bacon2D.State
- mouse : QPointF
- stackLevel : int
- ups : int
Methods
Detailed Description
The Game component is the root game component which contains one or more Scene components. Only one Scene will be set as currentScene.
Example usage:
import QtQuick 2.0 import Bacon2D 1.0 Game { id: game width: 800 height: 600 Scene { id: scene width: 300 height: 300 } }
Property Documentation
currentScene : Scene |
The current Scene
This property holds the current gameState.
This enum type is used to specify the current state of the game. | |
---|---|
State | Description |
Bacon2D.Active | Game is active and the currentScene is not running |
Bacon2D.Inactive | Game is inactive |
Bacon2D.Running | Game is active and the currentScene is running |
Bacon2D.Paused | Game is paused by user request. |
Bacon2D.Suspended | Game is suspended, usually means the platform has stopped the process or the game is no longer focused. |
See also Qt.ApplicationState.
This property holds the number of times update is called per second.
Updates per second can be used to control the speed of the game loop. The default is 30.
Method Documentation
Scene * popScene() |
Suspends and remove the top Scene from the scene stack. Suspends and remove the current Scene from stack. If exitAnimation property the exit will be animated. When there is no scene on stack, it will do nothing.
See also pushScene.
void pushScene(Scene * scene) |
Suspends the execution of the running scene, while add a new Scene to the Scene stack. If the Scene has the enterAnimation property set, the push will be animated.
Warning: Pushing scenes already on stack will remove it from the current position and place it on top of the stack.
See also popScene.