ZApplication
The application component. This component is automatically created when you start a new project.
Properties
States
A list of AppState components that the application use.
OnLoaded
This list is executed once at program start. Put your application initialization components here.
OnUpdate
Called once between every frame update.
OnRender
A list of render commands.
Content
The application content list. Put your game components here.
Caption
A text string that is displayed in the window caption of your application.
ClearScreenMode
If set to 0 the the screen is cleared before every frame update. If a value other than zero, then the screen is not cleared. Use this for feedback effects. See the Particles-sample project for how to use this property.
ClearColor
The color that the screen will be cleared with. Default black.
FullScreen
Set this property to make your application run in fullscreen mode.
You can override this property with the following command line switches:
- -w Force windowed mode
- -f Force fullscreen mode
ScreenMode
Select the screen resolution for your application.
FrameRateStyle
Set to one of preset values:
- SyncedWithMonitor - (default) the frame rate will be limited to the monitors refresh rate. Defaults to 60 if the rate can't be determined.
- Free - the frame rate will be as high as possible, this will use maximum cpu.
- Fixed - the frame rate will attempt to match the value set in the FixedFrameRate-property.
FixedFrameRate
Controls the desired framerate when FrameRateStyle is set to Fixed.
ShowOptionsDialog
Set this property to display a dialogbox where the user can choose screen resolution and fullscreen-option on startup of your game. This features currently only works on Windows and Linux.
CustomScreenWidth/CustomScreenWidth
If these properties contains other values than zero, this screensize is used instead of the ScreenMode property. Use this for setting custom windowed modes such as a vertical shooting game.
ViewportRatio
Set to one of preset values:
- Full Window - This is the default. The whole screen area is used for rendering. This means that depending on the ratio of the screen resolution the bounds of the visible area of your game world will be slightly different which may not always be desirable.
- Custom - Use the value of the CustomViewportRatio
- 4:3 - Use standard (non-widescreen) viewport ratio
- 16:9 - Use widescreen ratio
CustomViewportRatio
Set a value here to use a custom viewport-ratio.
DeltaTime
The time in seconds that has passed since last frame was rendered. Use this value when updating model positions in expressions to make your game frame-rate independent. Read only.
Example of expression using the deltatime-property: "CurrentModel.Position.X+=1*App.DeltaTime;".
Time
Time in seconds since application was started. Read only.
FpsCounter
The current number of frames per second. This value can be displayed on screen using the RenderText-component and is useful for detecting performance issues. Read only.
CollidedCategory
When a OnCollision-component list on a Model is executed this property contains the category that the model collided with. Read only.
MousePosition
X and Y coordinates of the current mouse position, in -1 to 1 range. Read only.
LightPosition
The position or direction of the OpenGL light. The default OpenGL light is directional, and the default value of this property is a direction down the Z-axis.
FOV
Camera Field Of View. Default value is 45 degrees.
CameraPosition
The current position of the camera. Animate this property to make scrolling games. For example writing "App.CameraPosition.X=App.Time * 0.5;" in a ZExpression will move the screen slowly to the left.
CameraRotation
The current rotation of the camera in X,Y and Z axis.
ClipNear
The near clipping distance of OpenGL graphics. Objects that are closer to the camera than this value will not be drawn.
ClipFar
The far clipping distance of OpenGL graphics. Objects that are further away from the camera than this value will not be drawn.
Icon
Load a ICO-file to this property for customizing the application icon of the generated exe-file. Note: The icon is only inserted in compressed Windows exe-files, not for other platforms.