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.

Instance Attribute Summary collapse

Constructors collapse

Managing Scenes collapse

Instance Method Summary collapse

Instance Attribute Details

#content_scale_factorFloat

Returns the scale factor of content for multi-resolution.

Returns:

  • (Float)

    the scale factor of content for multi-resolution.



500
501
502
# File 'doc/API_reference.rb', line 500

def content_scale_factor
  @content_scale_factor
end

#glviewGLView (readonly)

Returns a GLView instance.

Returns:

  • (GLView)

    a GLView instance.



503
504
505
# File 'doc/API_reference.rb', line 503

def glview
  @glview
end

#originPoint (readonly)

Returns the visible origin of the director view in points.

Returns:

  • (Point)

    the visible origin of the director view in points.



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

def origin
  @origin
end

#sizeSize (readonly)

Returns the visible size of the director view in points.

Returns:

  • (Size)

    the visible size of the director view in points.



487
488
489
# File 'doc/API_reference.rb', line 487

def size
  @size
end

Class Method Details

.sharedDirector

Returns the shared Director instance.

Returns:

  • (Director)

    the shared Director instance.



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

def self.shared; end

Instance Method Details

#endself

Ends the execution of the running scene.

Returns:

  • (self)

    the receiver.



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

def end; end

#pauseself

Pauses the execution of the running scene.

Returns:

  • (self)

    the receiver.



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

def pause; end

#popself

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:

  • (self)

    the receiver.



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

def pop; end

#push(scene) ⇒ self

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

Parameters:

  • scene (Scene)

    the new scene to run.

Returns:

  • (self)

    the receiver.



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

def push(scene); end

#replace(scene) ⇒ self

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:

  • (self)

    the receiver.



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

def replace(scene); end

#resumeself

Resumes the execution of the current paused scene.

Returns:

  • (self)

    the receiver.



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

def resume; end

#run(scene) ⇒ self

Runs the given scene object.

Parameters:

  • scene (Scene)

    the scene to run.

Returns:

  • (self)

    the receiver.



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

def run(scene); end

#show_stats=(value) ⇒ Object

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.

Parameters:

  • value (Boolean)

    true if display the FPS label.



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

def show_stats=(value); 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.



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

def show_stats?; end

#start_animationself

The main loop is triggered again.

Returns:

  • (self)

    the receiver.



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

def start_animation; end

#stop_animationself

Stops the animation.

Returns:

  • (self)

    the receiver.



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

def stop_animation; end