Class: Yuki::Tilemap::MapData
- Defined in:
- docs/4_Systems_003_Map_Engine.rb
Overview
Class containing the map Data and its resources
Defined Under Namespace
Classes: AnimatedTileCounter
Constant Summary collapse
- POSITION_LOADERS =
List of method that help to load the position
{north: :load_position_north, south: :load_position_south, east: :load_position_east, west: :load_position_west, self: :load_position_self}
Class Attribute Summary collapse
-
.tileset_chunks ⇒ Hash{filename => Array<Texture>}
readonly
Get tileset chunks.
Instance Attribute Summary collapse
-
#map ⇒ RPG::Map
readonly
Get access to the original map data.
-
#map_id ⇒ Integer
readonly
Get the map id.
-
#offset_x ⇒ Integer
readonly
Get the map offset_x.
-
#offset_y ⇒ Integer
readonly
Get the map offset_y.
-
#side ⇒ Symbol
readonly
Get the side of the map.
-
#tileset_name ⇒ String
readonly
Get the tileset filename (to prevent unwanted dispose in the future).
-
#x_range ⇒ Range
readonly
Get the map X coordinate range.
-
#y_range ⇒ Range
readonly
Get the map Y coordinate range.
Instance Method Summary collapse
-
#[](x, y, z)
Get a tile from the map.
-
#assign_tile_to_sprite(sprite, tile_id)
Set tile sprite to sprite.
-
#draw(x, y, tx, ty, tz, layer)
Draw the tile on the right layer.
-
#draw_map(x, y, rx, ry, layers)
Draw the visible part of the map.
-
#initialize(map, map_id) ⇒ MapData
constructor
Create a new MapData.
-
#load_position(map, side, offset)
Sets the position of the map in the 2D Space.
-
#load_tileset
Load the tileset.
-
#update_counters
Update the autotiles counter (for tilemap).
Constructor Details
#initialize(map, map_id) ⇒ MapData
Create a new MapData
1404 1405 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1404 def initialize(map, map_id) end |
Class Attribute Details
.tileset_chunks ⇒ Hash{filename => Array<Texture>} (readonly)
Get tileset chunks
1490 1491 1492 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1490 def tileset_chunks @tileset_chunks end |
Instance Attribute Details
#map ⇒ RPG::Map (readonly)
Get access to the original map data
1378 1379 1380 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1378 def map @map end |
#map_id ⇒ Integer (readonly)
Get the map id
1381 1382 1383 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1381 def map_id @map_id end |
#offset_x ⇒ Integer (readonly)
Get the map offset_x
1390 1391 1392 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1390 def offset_x @offset_x end |
#offset_y ⇒ Integer (readonly)
Get the map offset_y
1393 1394 1395 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1393 def offset_y @offset_y end |
#side ⇒ Symbol (readonly)
Get the side of the map
1399 1400 1401 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1399 def side @side end |
#tileset_name ⇒ String (readonly)
Get the tileset filename (to prevent unwanted dispose in the future)
1396 1397 1398 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1396 def tileset_name @tileset_name end |
#x_range ⇒ Range (readonly)
Get the map X coordinate range
1384 1385 1386 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1384 def x_range @x_range end |
#y_range ⇒ Range (readonly)
Get the map Y coordinate range
1387 1388 1389 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1387 def y_range @y_range end |
Instance Method Details
#[](x, y, z)
Get a tile from the map
1416 1417 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1416 def [](x, y, z) end |
#assign_tile_to_sprite(sprite, tile_id)
Set tile sprite to sprite
1421 1422 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1421 def assign_tile_to_sprite(sprite, tile_id) end |
#draw(x, y, tx, ty, tz, layer)
Draw the tile on the right layer
1430 1431 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1430 def draw(x, y, tx, ty, tz, layer) end |
#draw_map(x, y, rx, ry, layers)
Draw the visible part of the map
1438 1439 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1438 def draw_map(x, y, rx, ry, layers) end |
#load_position(map, side, offset)
Sets the position of the map in the 2D Space
1410 1411 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1410 def load_position(map, side, offset) end |
#load_tileset
Load the tileset
1441 1442 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1441 def load_tileset end |
#update_counters
Update the autotiles counter (for tilemap)
1444 1445 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 1444 def update_counters end |