RPG::Tileset

The data class for tile sets.

Superclass

Attributes

id

The ID of the tile set.

name

The name of the tile set.

mode

The mode of the tile set (0: Field type, 1: Area type, 2: VX compatible type).

tileset_names[index]

The file name of the graphic used as the number index (0-8) tile set.

The correspondence between numbers and sets is illustrated in the table below.

0TileA1 1TileA2 2TileA3
3TileA4 4TileA5 5TileB
6TileC 7TileD 8TileE
flags

The flags table. A 1-dimensional array containing a variety of flags (Table).

Uses tile IDs as subscripts. The correspondence of each bit is as shown below:

This manual does not discuss bit operations, but they are similar to those in C. We recommend an Internet search using keywords such as "hexadecimal bit operations" when necessary.

note

The text of the note.

Definition

class RPG::Tileset
  def initialize
    @id = 0
    @mode = 1
    @name = ''
    @tileset_names = Array.new(9).collect{''}
    @flags = Table.new(8192)
    @flags[0] = 0x0010
    (2048..2815).each {|i| @flags[i] = 0x000F}
    (4352..8191).each {|i| @flags[i] = 0x000F}
    @note = ''
  end
  attr_accessor :id
  attr_accessor :mode
  attr_accessor :name
  attr_accessor :tileset_names
  attr_accessor :flags
  attr_accessor :note
end