Class: UI::MiningGame::Hit_Counter_Sprite
- Inherits:
-
SpriteSheet
- Object
- LiteRGSS::Disposable
- LiteRGSS::Drawable
- LiteRGSS::Sprite
- LiteRGSS::ShaderedSprite
- Sprite
- ShaderedSprite
- SpriteSheet
- UI::MiningGame::Hit_Counter_Sprite
- Defined in:
- scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb
Overview
Class that describes the Hit_Counter_Sprite
Instance Attribute Summary collapse
-
#reason ⇒ Symbol
The symbol corresponding to the Hit_Counter_Sprite number (:first or :not_first).
-
#state ⇒ Integer
The current state.
Attributes inherited from SpriteSheet
Attributes inherited from LiteRGSS::ShaderedSprite
Attributes inherited from LiteRGSS::Sprite
#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y
Instance Method Summary collapse
-
#change_state
Change the state of the Hit_Counter_Sprite.
-
#initialize(viewport, reason) ⇒ Hit_Counter_Sprite
constructor
Create the Hit_Counter_Sprite.
-
#number_of_image_y ⇒ Integer
Return the number of images on a same column.
Methods inherited from SpriteSheet
Methods inherited from Sprite
#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords, #update
Methods inherited from LiteRGSS::Sprite
new, #set_origin, #set_position
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(viewport, reason) ⇒ Hit_Counter_Sprite
Create the Hit_Counter_Sprite
13 14 15 16 17 18 19 |
# File 'scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb', line 13 def initialize(, reason) @reason = reason super(, number_of_image_x, number_of_image_y) set_bitmap(bitmap_filename, :interface) @state = -1 set_visible end |
Instance Attribute Details
#reason ⇒ Symbol
Returns the symbol corresponding to the Hit_Counter_Sprite number (:first or :not_first).
8 9 10 |
# File 'scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb', line 8 def reason @reason end |
#state ⇒ Integer
Returns the current state.
6 7 8 |
# File 'scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb', line 6 def state @state end |
Instance Method Details
#change_state
Change the state of the Hit_Counter_Sprite
22 23 24 25 26 |
# File 'scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb', line 22 def change_state @state += 1 update_sheet set_visible unless @state > 0 end |
#number_of_image_y ⇒ Integer
Return the number of images on a same column
30 31 32 33 34 35 36 |
# File 'scripts/01450 Systems/08001 Mining Game/00030 UI_Mining_Game/00004 Hit_Counter_Sprite.rb', line 30 def number_of_image_y if @reason == :first return 9 else return 7 end end |