Class: Tilemap
- Inherits:
-
Object
- Object
- Tilemap
- Defined in:
- lib/tilemap.rb
Overview
The class governing tilemaps. Tilemaps are a specialized concept used in 2D game map displays, created internally from multiple sprites.
Instance Attribute Summary collapse
-
#autotiles ⇒ Bitmap
Refers to the Bitmap used as an autotile with an index number from 0 to 6.
-
#flash_data ⇒ Table
Refers to the flash data Table used when showing range of possible movement in simulation games, etc.
-
#map_data ⇒ Table
Refers to the map data Table.
-
#ox ⇒ Object
The X-coordinate of the tilemap’s starting point.
-
#oy ⇒ Object
The Y-coordinate of the tilemap’s starting point.
-
#priorities ⇒ Bitmap
Reference to the priority Table.
-
#tileset ⇒ Bitmap
Refers to the Bitmap used as a tileset.
-
#visible ⇒ Object
The tilemap’s visibility.
Instance Method Summary collapse
-
#disposed ⇒ Object
Frees the tilemap.
-
#disposed? ⇒ Boolean
Returns TRUE if the tilemap has been freed.
-
#initialize(viewport = nil) ⇒ Tilemap
constructor
A new instance of Tilemap.
Constructor Details
#initialize(viewport = nil) ⇒ Tilemap
Returns a new instance of Tilemap.
42 43 44 45 46 |
# File 'lib/tilemap.rb', line 42 def initialize( = nil) raise "not implemented" @viewport = end |
Instance Attribute Details
#autotiles ⇒ Bitmap
Refers to the Bitmap used as an autotile with an index number from 0 to 6.
10 11 12 |
# File 'lib/tilemap.rb', line 10 def autotiles @autotiles end |
#flash_data ⇒ Table
Refers to the flash data Table used when showing range of possible movement in simulation games, etc. Defines a 2-dimensional array measuring [ horizontal size * vertical size ]. This array must be the same size as the map data. Each element uses 4 bits to represent a tile’s flash color in RGB; for example, 0xf84 flashes in RGB(15,8,4).
24 25 26 |
# File 'lib/tilemap.rb', line 24 def flash_data @flash_data end |
#map_data ⇒ Table
Refers to the map data Table. Defines a 3-dimensional array measuring [ horizontal size * vertical size * 3 ].
16 17 18 |
# File 'lib/tilemap.rb', line 16 def map_data @map_data end |
#ox ⇒ Object
The X-coordinate of the tilemap’s starting point. Change this value to scroll the tilemap.
36 37 38 |
# File 'lib/tilemap.rb', line 36 def ox @ox end |
#oy ⇒ Object
The Y-coordinate of the tilemap’s starting point. Change this value to scroll the tilemap.
40 41 42 |
# File 'lib/tilemap.rb', line 40 def oy @oy end |
#priorities ⇒ Bitmap
Reference to the priority Table. Defines a 1-dimensional array containing elements corresponding to tile IDs.
29 30 31 |
# File 'lib/tilemap.rb', line 29 def priorities @priorities end |
#tileset ⇒ Bitmap
Refers to the Bitmap used as a tileset.
6 7 8 |
# File 'lib/tilemap.rb', line 6 def tileset @tileset end |
#visible ⇒ Object
The tilemap’s visibility. If TRUE, the tilemap is visible.
32 33 34 |
# File 'lib/tilemap.rb', line 32 def visible @visible end |
Instance Method Details
#disposed ⇒ Object
Frees the tilemap. If the tilemap has already been freed, does nothing.
49 50 51 52 53 |
# File 'lib/tilemap.rb', line 49 def disposed() raise "not implemented" @disposed = true end |
#disposed? ⇒ Boolean
Returns TRUE if the tilemap has been freed.
56 57 58 |
# File 'lib/tilemap.rb', line 56 def disposed?() @disposed end |