Class: UI::MiningGame::Tiles

Overview

Class that describes the Tiles sprite

Instance Attribute Summary collapse

Attributes inherited from SpriteSheet

#nb_x, #nb_y, #sx, #sy

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

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

Methods inherited from SpriteSheet

#bitmap=, #resize, #select

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

#set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, state) ⇒ Tiles

Create the Tiles

Parameters:

  • viewport (Viewport)
  • state (Integer) —

    the state the image is initialized on (between 0 and 6)



511
512
# File 'docs/4_Systems_801_Mining_Game.rb', line 511

def initialize(viewport, state)
end

Instance Attribute Details

#state ⇒ Integer

Returns state of the tile.

Returns:

  • (Integer) —

    state of the tile



507
508
509
# File 'docs/4_Systems_801_Mining_Game.rb', line 507

def state
  @state
end

Instance Method Details

#lower_state(reason)

Lower the state and update the image in consequence

Parameters:

  • reason (Symbol) —

    the reason of lowering



518
519
# File 'docs/4_Systems_801_Mining_Game.rb', line 518

def lower_state(reason)
end

#update_sx

Update the state of the sheet



514
515
# File 'docs/4_Systems_801_Mining_Game.rb', line 514

def update_sx
end