CPBaseContext

org.cosplay.CPBaseContext

Base type for various scene-related context classes.

Attributes

See also
Source
CPBaseContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def getFrameCount: Long

Gets global frame count for the game. Global frame count spans all scenes.

Gets global frame count for the game. Global frame count spans all scenes.

Attributes

Source
CPBaseContext.scala
def getFrameMs: Long

Gets the timestamp in milliseconds for the current frame.

Gets the timestamp in milliseconds for the current frame.

This value will be the same for all objects across all callbacks for the entirety of the current frame processing. It is used to provide the time simultaneity across all scene objects at a given frame.

Attributes

Source
CPBaseContext.scala

Gets game-wide cache. Game-wide cache can be used to share data across scenes.

Gets game-wide cache. Game-wide cache can be used to share data across scenes.

A cache is a map-like type that is used for game-wide and scene-wide user-data containers. The instances of this class are created and managed by the game engine. Scene and game caches can be used to exchange and store user-defined data between frames of the same scene or between scenes of the game. Note that by default these caches are in-memory only and not persistent between game executions. One could, however, add persistence using one of the lifecycle methods available through CPLifecycle type that is extended by both CPSceneObject and CPScene types.

Attributes

See also
Source
CPBaseContext.scala
def getLog: CPLog

Gets log instance.

Gets log instance.

Attributes

Source
CPBaseContext.scala

Gets scene-wide cache. Scene-wide cache gets cleared when scene changes.

Gets scene-wide cache. Scene-wide cache gets cleared when scene changes.

A cache is a map-like type that is used for game-wide and scene-wide user-data containers. The instances of this class are created and managed by the game engine. Scene and game caches can be used to exchange and store user-defined data between frames of the same scene or between scenes of the game. Note that by default these caches are in-memory only and not persistent between game executions. One could, however, add persistence using one of the lifecycle methods available through CPLifecycle type that is extended by both CPSceneObject and CPScene types.

Attributes

See also
Source
CPBaseContext.scala
def getSceneFrameCount: Long

Gets frame count since the beginning of the current scene. If the same scene gets deactivated and activated again its frame count will reset to zero.

Gets frame count since the beginning of the current scene. If the same scene gets deactivated and activated again its frame count will reset to zero.

Attributes

Source
CPBaseContext.scala
def getStartGameMs: Long

Gets the timestamp in milliseconds of the game start.

Gets the timestamp in milliseconds of the game start.

Attributes

Source
CPBaseContext.scala
def getStartSceneMs: Long

Gets the timestamp in milliseconds of the current scene start.

Gets the timestamp in milliseconds of the current scene start.

Attributes

Source
CPBaseContext.scala