Class: OR2D::Scenes::PlaceholderScene

Inherits:
OR2D::Scene show all
Defined in:
lib/or2d/scenes/placeholder_scene.rb

Overview

The PlaceholderScene class is a placeholder scene for the OR2D gem. When no other scenes are enqueued or displayed, this scene will be displayed.

Since:

  • 2023-04-26

Instance Attribute Summary

Attributes inherited from OR2D::Scene

#id

Instance Method Summary collapse

Methods inherited from OR2D::Scene

#finished?, #redraw?, #render, #rendered?, #update

Constructor Details

#initializePlaceholderScene

Construct a new PlaceholderScene object.

Since:

  • 2023-04-26



6
7
8
9
10
11
12
# File 'lib/or2d/scenes/placeholder_scene.rb', line 6

def initialize
  super('PLACEHOLDER_SCENE')
  @cursor_position = OR2D::Entity.new(:text, { color: 'white', x: 0, y: 0, size: 16, height: 16, width: 16 })

  setup_events
  setup_console
end

Instance Method Details

#finishObject

Complete processing of the scene

Since:

  • 2023-04-26



15
16
17
18
19
20
# File 'lib/or2d/scenes/placeholder_scene.rb', line 15

def finish
  @console.remove
  @cursor_position.destroy
  @descriptors.each_value { |descriptor| OR2D.game.window.off(descriptor) }
  super
end