Class: MG::Director

Inherits:
Object
  • Object
show all
Defined in:
motion-game

Overview

Director is a shared object that takes care of the scene graph.

Properties (collapse)

Constructors (collapse)

Managing Scenes (collapse)

Instance Attribute Details

- (Point) origin (readonly)

Returns the visible origin of the director view in points.

Returns:

  • (Point)

    the visible origin of the director view in points.



130
131
132
# File 'motion-game', line 130

def origin
  @origin
end

- (Boolean) show_stats?

Controls whether the FPS (frame-per-second) statistic label is displayed in the bottom-left corner of the director view. By default it is hidden.

Returns:

  • (Boolean)

    whether the FPS label is displayed.



138
139
140
# File 'motion-game', line 138

def show_stats?
  @show_stats?
end

- (Size) size (readonly)

Returns the visible size of the director view in points.

Returns:

  • (Size)

    the visible size of the director view in points.



133
134
135
# File 'motion-game', line 133

def size
  @size
end

Class Method Details

+ (Director) shared

Returns the shared Director instance.

Returns:

  • (Director)

    the shared Director instance.



87
# File 'motion-game', line 87

def self.shared; end

Instance Method Details

- (Director) end

Ends the execution of the running scene.

Returns:



116
# File 'motion-game', line 116

def end; end

- (Director) pause

Pauses the execution of the running scene.

Returns:



120
# File 'motion-game', line 120

def pause; end

- (Director) pop

Pops the running scene from the stack, and starts running the previous scene. If there are no more scenes to run, the execution will be stopped.

Returns:



112
# File 'motion-game', line 112

def pop; end

- (Director) push(scene)

Suspends the execution of the running scene, and starts running the given scene instead.

Parameters:

  • scene (Scene)

    the new scene to run.

Returns:



107
# File 'motion-game', line 107

def push(scene); end

- (Director) replace(scene)

Replaces the current scene with a new one. The running scene will be terminated.

Parameters:

  • scene (Scene)

    the scene to replace the current one with.

Returns:



101
# File 'motion-game', line 101

def replace(scene); end

- (Director) resume

Resumes the execution of the current paused scene.

Returns:



124
# File 'motion-game', line 124

def resume; end

- (Director) run(scene)

Runs the given scene object.

Parameters:

  • scene (Scene)

    the scene to run.

Returns:



95
# File 'motion-game', line 95

def run(scene); end