Class: Core::States::State
Overview
Skeleton for game states
Provides a cursor
Direct Known Subclasses
AlchemyMenu, BattleState, EquipMenu, GameState, IngameMenu, MagicMenu, OptionMenu, StartMenu
Instance Attribute Summary collapse
-
#window ⇒ Object
readonly
Returns the value of attribute window.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #draw ⇒ Object
- #draw_cursor ⇒ Object
- #finish ⇒ Object
-
#initialize(window) ⇒ State
constructor
A new instance of State.
- #update ⇒ Object
- #update_cursor ⇒ Object
Constructor Details
Instance Attribute Details
#window ⇒ Object (readonly)
Returns the value of attribute window.
12 13 14 |
# File 'lib/states/states.rb', line 12 def window @window end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
12 13 14 |
# File 'lib/states/states.rb', line 12 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
12 13 14 |
# File 'lib/states/states.rb', line 12 def y @y end |
Instance Method Details
#draw ⇒ Object
25 26 27 |
# File 'lib/states/states.rb', line 25 def draw draw_cursor end |
#draw_cursor ⇒ Object
28 29 30 |
# File 'lib/states/states.rb', line 28 def draw_cursor @cursor.draw end |
#finish ⇒ Object
31 32 |
# File 'lib/states/states.rb', line 31 def finish end |
#update ⇒ Object
18 19 20 |
# File 'lib/states/states.rb', line 18 def update update_cursor end |
#update_cursor ⇒ Object
21 22 23 24 |
# File 'lib/states/states.rb', line 21 def update_cursor @x, @y = @window.mouse_x, @window.mouse_y @cursor.update(@x, @y) end |