CPAnimationContext

Animation context that is passed into CPAnimation.keyFrame method.

See also:
Example:

See CPAnimationExample source code for an example of animation functionality.

Source:
CPAnimationContext.scala
class Object
trait Matchable
class Any

Value members

Abstract methods

def getId: String

ID of the scene object the rendering is used by.

ID of the scene object the rendering is used by.

See also:
Source:
CPAnimationContext.scala
def getX: Int

X-coordinate of the scene object rendering the animation.

X-coordinate of the scene object rendering the animation.

See also:
Source:
CPAnimationContext.scala
def getY: Int

Y-coordinate of the scene object rendering the animation.

Y-coordinate of the scene object rendering the animation.

See also:
Source:
CPAnimationContext.scala
def getZ: Int

Z-index of the scene object rendering the animation.

Z-index of the scene object rendering the animation.

See also:
Source:
CPAnimationContext.scala
def receiveMessage(): Seq[AnyRef]

Gets direct messages send to this scene object, if any. Returns an empty sequence if no messages pending delivery. Note that sent messages are stored until they are retrieved or the scene is changed.

Gets direct messages send to this scene object, if any. Returns an empty sequence if no messages pending delivery. Note that sent messages are stored until they are retrieved or the scene is changed.

Source:
CPAnimationContext.scala
def sendMessage(id: String, msgs: AnyRef*): Unit

Sends direct message(s) to the scene object with given ID. Scene object must belong to the current scene, i.e. one cannot send a message to the scene objects from another scene. To exchange data between scenes you should use game cache. Note that messages will be available to recipient scene objects starting with the next frame. Messages will be stored until they are retrieved or the scene is changed.

Sends direct message(s) to the scene object with given ID. Scene object must belong to the current scene, i.e. one cannot send a message to the scene objects from another scene. To exchange data between scenes you should use game cache. Note that messages will be available to recipient scene objects starting with the next frame. Messages will be stored until they are retrieved or the scene is changed.

Value parameters:
id

ID of the game object to send messages to.

msgs

Sequence of zero or messages (objects) to send.

Source:
CPAnimationContext.scala

Inherited methods

def getFrameCount: Long

Gets global frame count for the game.

Gets global frame count for the game.

Inherited from:
CPBaseContext
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.

Inherited from:
CPBaseContext
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.

See also:
Inherited from:
CPBaseContext
Source:
CPBaseContext.scala

Gets log instance.

Gets log instance.

Inherited from:
CPBaseContext
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.

See also:
Inherited from:
CPBaseContext
Source:
CPBaseContext.scala

Gets frame count since the beginning of the current scene.

Gets frame count since the beginning of the current scene.

Inherited from:
CPBaseContext
Source:
CPBaseContext.scala
def getStartGameMs: Long

Gets the timestamp in milliseconds of the game start.

Gets the timestamp in milliseconds of the game start.

Inherited from:
CPBaseContext
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.

Inherited from:
CPBaseContext
Source:
CPBaseContext.scala