Class: MG::Director

Inherits:
Object
  • Object
show all
Defined in:
doc/API_reference.rb

Overview

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

Properties collapse

Constructors collapse

Managing Scenes collapse

Instance Attribute Details

#originPoint (readonly)

Returns the visible origin of the director view in points.

Returns:

  • (Point)

    the visible origin of the director view in points.



490
491
492
# File 'doc/API_reference.rb', line 490

def origin
  @origin
end

#show_stats?Boolean

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.



498
499
500
# File 'doc/API_reference.rb', line 498

def show_stats?
  @show_stats?
end

#sizeSize (readonly)

Returns the visible size of the director view in points.

Returns:

  • (Size)

    the visible size of the director view in points.



493
494
495
# File 'doc/API_reference.rb', line 493

def size
  @size
end

Class Method Details

.sharedDirector

Returns the shared Director instance.

Returns:

  • (Director)

    the shared Director instance.



439
# File 'doc/API_reference.rb', line 439

def self.shared; end

Instance Method Details

#endDirector

Ends the execution of the running scene.

Returns:



468
# File 'doc/API_reference.rb', line 468

def end; end

#pauseDirector

Pauses the execution of the running scene.

Returns:



472
# File 'doc/API_reference.rb', line 472

def pause; end

#popDirector

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:



464
# File 'doc/API_reference.rb', line 464

def pop; end

#push(scene) ⇒ Director

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

Parameters:

  • scene (Scene)

    the new scene to run.

Returns:



459
# File 'doc/API_reference.rb', line 459

def push(scene); end

#replace(scene) ⇒ Director

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:



453
# File 'doc/API_reference.rb', line 453

def replace(scene); end

#resumeDirector

Resumes the execution of the current paused scene.

Returns:



476
# File 'doc/API_reference.rb', line 476

def resume; end

#run(scene) ⇒ Director

Runs the given scene object.

Parameters:

  • scene (Scene)

    the scene to run.

Returns:



447
# File 'doc/API_reference.rb', line 447

def run(scene); end

#start_animationDirector

The main loop is triggered again.

Returns:



480
# File 'doc/API_reference.rb', line 480

def start_animation; end

#stop_animationDirector

Stops the animation.

Returns:



484
# File 'doc/API_reference.rb', line 484

def stop_animation; end