Class: RPG::Tileset

Inherits:
Object
  • Object
show all
Defined in:
lib/rpg/tileset.rb

Overview

Data class for tilesets.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTileset

Returns a new instance of Tileset.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rpg/tileset.rb', line 6

def initialize
  @id = 0
  @name = ""
  @tileset_name = ""
  @autotile_names = [""]*7
  @panorama_name = ""
  @panorama_hue = 0
  @fog_name = ""
  @fog_hue = 0
  @fog_opacity = 64
  @fog_blend_type = 0
  @fog_zoom = 200
  @fog_sx = 0
  @fog_sy = 0
  @battleback_name = ""
  @passages = Table.new(384)
  @priorities = Table.new(384)
  @priorities[0] = 5
  @terrain_tags = Table.new(384)
end

Instance Attribute Details

#autotile_namesObject

The autotile graphic’s file name array ([0]..).



37
38
39
# File 'lib/rpg/tileset.rb', line 37

def autotile_names
  @autotile_names
end

#battleback_nameObject

The battle background’s graphic file name.



67
68
69
# File 'lib/rpg/tileset.rb', line 67

def battleback_name
  @battleback_name
end

#fog_blend_typeObject

The fog’s blending mode.



55
56
57
# File 'lib/rpg/tileset.rb', line 55

def fog_blend_type
  @fog_blend_type
end

#fog_hueObject

The adjustment value for the fog graphic’s hue (0..360).



49
50
51
# File 'lib/rpg/tileset.rb', line 49

def fog_hue
  @fog_hue
end

#fog_nameObject

The fog graphic’s file name.



46
47
48
# File 'lib/rpg/tileset.rb', line 46

def fog_name
  @fog_name
end

#fog_opacityObject

The fog’s opacity.



52
53
54
# File 'lib/rpg/tileset.rb', line 52

def fog_opacity
  @fog_opacity
end

#fog_sxObject

The fog’s SX (automatic X-axis scrolling speed).



61
62
63
# File 'lib/rpg/tileset.rb', line 61

def fog_sx
  @fog_sx
end

#fog_syObject

The fog’s SY (automatic Y-axis scrolling speed).



64
65
66
# File 'lib/rpg/tileset.rb', line 64

def fog_sy
  @fog_sy
end

#fog_zoomObject

The fog’s zoom level.



58
59
60
# File 'lib/rpg/tileset.rb', line 58

def fog_zoom
  @fog_zoom
end

#idObject

The tileset ID.



28
29
30
# File 'lib/rpg/tileset.rb', line 28

def id
  @id
end

#nameObject

The tileset name.



31
32
33
# File 'lib/rpg/tileset.rb', line 31

def name
  @name
end

#panorama_hueObject

The adjustment value for the panorama graphic’s hue (0..360).



43
44
45
# File 'lib/rpg/tileset.rb', line 43

def panorama_hue
  @panorama_hue
end

#panorama_nameObject

The panorama graphic file name.



40
41
42
# File 'lib/rpg/tileset.rb', line 40

def panorama_name
  @panorama_name
end

#passagesTable

Passage table. A 1-dimensional Table containing passage flags, Bush flags, and counter flags.

The tile ID is used as a subscript. Each bit is handled as follows:

0x01

Cannot move down.

0x02

Cannot move left.

0x04

Cannot move right.

0x08

Cannot move up.

0x40

Bush flag.

0x80

Counter flag.

Returns:



80
81
82
# File 'lib/rpg/tileset.rb', line 80

def passages
  @passages
end

#prioritiesTable

Priority table. A 1-dimensional Table containing priority data.

The tile ID is used as a subscript.

Returns:



86
87
88
# File 'lib/rpg/tileset.rb', line 86

def priorities
  @priorities
end

#terrain_tagsTable

Terrain tag table A 1-dimensional Table containing terrain tag data.

The tile ID is used as a subscript.

Returns:



92
93
94
# File 'lib/rpg/tileset.rb', line 92

def terrain_tags
  @terrain_tags
end

#tileset_nameObject

The tileset’s graphic file name.



34
35
36
# File 'lib/rpg/tileset.rb', line 34

def tileset_name
  @tileset_name
end