Class: Tilemap
- Inherits:
-
Object
- Object
- Tilemap
- Defined in:
- lib/rgss3/tilemap.rb
Constant Summary collapse
- TILESIZE =
32
Instance Attribute Summary collapse
-
#bitmaps ⇒ Object
Returns the value of attribute bitmaps.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#flash_data ⇒ Object
Returns the value of attribute flash_data.
-
#map_data ⇒ Object
Returns the value of attribute map_data.
-
#ox ⇒ Object
Returns the value of attribute ox.
-
#oy ⇒ Object
Returns the value of attribute oy.
-
#viewport ⇒ Object
Returns the value of attribute viewport.
-
#visible ⇒ Object
Returns the value of attribute visible.
Instance Method Summary collapse
- #dispose ⇒ Object
- #disposed? ⇒ Boolean
-
#initialize(viewport = nil) ⇒ Tilemap
constructor
A new instance of Tilemap.
- #update ⇒ Object
Constructor Details
#initialize(viewport = nil) ⇒ Tilemap
Returns a new instance of Tilemap.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rgss3/tilemap.rb', line 15 def initialize( = nil) @bitmaps = [] @viewport = @visible = true @ox = 0 @oy = 0 @animated_layer = [] @layers = [Plane.new, Plane.new, Plane.new] @anim_count = 0 @disposed = false @layers[0].z = 0 @layers[0]. = @viewport @layers[1].z = 100 @layers[1]. = @viewport @layers[2].z = 200 @layers[2]. = @viewport end |
Instance Attribute Details
#bitmaps ⇒ Object
Returns the value of attribute bitmaps.
6 7 8 |
# File 'lib/rgss3/tilemap.rb', line 6 def bitmaps @bitmaps end |
#flags ⇒ Object
Returns the value of attribute flags.
9 10 11 |
# File 'lib/rgss3/tilemap.rb', line 9 def flags @flags end |
#flash_data ⇒ Object
Returns the value of attribute flash_data.
8 9 10 |
# File 'lib/rgss3/tilemap.rb', line 8 def flash_data @flash_data end |
#map_data ⇒ Object
Returns the value of attribute map_data.
7 8 9 |
# File 'lib/rgss3/tilemap.rb', line 7 def map_data @map_data end |
#ox ⇒ Object
Returns the value of attribute ox.
12 13 14 |
# File 'lib/rgss3/tilemap.rb', line 12 def ox @ox end |
#oy ⇒ Object
Returns the value of attribute oy.
13 14 15 |
# File 'lib/rgss3/tilemap.rb', line 13 def oy @oy end |
#viewport ⇒ Object
Returns the value of attribute viewport.
10 11 12 |
# File 'lib/rgss3/tilemap.rb', line 10 def @viewport end |
#visible ⇒ Object
Returns the value of attribute visible.
11 12 13 |
# File 'lib/rgss3/tilemap.rb', line 11 def visible @visible end |
Instance Method Details
#dispose ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rgss3/tilemap.rb', line 58 def dispose for layer in @layers layer.bitmap.dispose layer.dispose end for layer in @animated_layer layer.dispose end @disposed = true end |
#disposed? ⇒ Boolean
69 70 71 |
# File 'lib/rgss3/tilemap.rb', line 69 def disposed? @disposed end |
#update ⇒ Object
73 74 75 76 |
# File 'lib/rgss3/tilemap.rb', line 73 def update @anim_count = (@anim_count + 1) % (@animated_layer.size * 30) @layers[0].bitmap = @animated_layer[@anim_count/30] end |