Class: UI::VoltorbFlip::MemoTile

Inherits:
Sprite show all
Defined in:
scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb

Overview

Memo tiles in VoltorbFlip game

Instance Attribute Summary

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 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

#dispose, #disposed?

Constructor Details

#initialize(viewport, index) ⇒ MemoTile

Create a new MemoTile

Parameters:



155
156
157
158
159
160
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 155

def initialize(viewport, index)
  super(viewport)
  @index = index
  set_bitmap('voltorbflip/memo_tiles', :interface)
  disable
end

Instance Method Details

#disable

Disable the tile



174
175
176
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 174

def disable
  set_rect_div(@index, 0, 4, 2)
end

#enable

Enable the tile



169
170
171
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 169

def enable
  set_rect_div(@index, 1, 4, 2)
end

#enabled?Boolean

Tell if the tile is enabled

Returns:

  • (Boolean)


164
165
166
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 164

def enabled?
  return src_rect.y > 0
end