📜
RGSS Reference Manual
  • RGSS Reference Manual
  • RGSS Specifications
  • Ruby Syntax
    • Syntax and Expressions
    • Variables and Constants
    • Literals
    • Operator Expressions
    • Control Structures
    • Method Calls
    • Class and Method Definitions
  • Standard Library
    • Built-in Functions
    • Built-in Variables
    • Built-in Classes
      • Object
        • Array
        • Exception
        • FalseClass
        • Hash
        • IO
          • File
        • MatchData
        • Module
          • Class
        • NilClass
        • Numeric
          • Integer
            • Bignum
            • Fixnum
          • Float
        • Range
        • Proc
        • Regexp
        • String
        • Symbol
        • Time
        • TrueClass
    • Built-in Modules
      • Comparable
      • Enumerable
      • Errno
      • FileTest
      • GC
      • Kernel
      • Marshal
      • Math
    • Built-in Exception Classes
  • Game Library
    • RGSS Built-in Functions
    • RGSS Built-in Classes
      • Bitmap
      • Color
      • Font
      • Plane
      • Rect
      • Sprite
      • Table
      • Tilemap
      • Tone
      • Viewport
      • Window
      • RGSSError
      • RPG::Sprite
      • RPG::Weather
    • RGSS Built-in Modules
      • Audio
      • Graphics
      • Input
      • RPG
      • RPG::Cache
    • RPGXP Data Structures
      • RPG::Map
      • RPG::MapInfo
      • RPG::Event
      • RPG::Event::Page
      • RPG::Event::Page::Condition
      • RPG::Event::Page::Graphic
      • RPG::EventCommand
      • RPG::MoveRoute
      • RPG::MoveCommand
      • RPG::Actor
      • RPG::Class
      • RPG::Class::Learning
      • RPG::Skill
      • RPG::Item
      • RPG::Weapon
      • RPG::Armor
      • RPG::Enemy
      • RPG::Enemy::Action
      • RPG::Troop
      • RPG::Troop::Member
      • RPG::Troop::Page
      • RPG::Troop::Page::Condition
      • RPG::State
      • RPG::Animation
      • RPG::Animation::Frame
      • RPG::Animation::Timing
      • RPG::Tileset
      • RPG::CommonEvent
      • RPG::System
      • RPG::System::Words
      • RPG::System::TestBattler
      • RPG::AudioFile
  • Appendix
    • Regular Expression
    • sprintf Format
Powered by GitBook
On this page
  • Superclass
  • Class Method
  • Tilemap.new([viewport])
  • Methods
  • dispose
  • disposed?
  • viewport
  • update
  • Properties
  • tileset
  • autotiles[index]
  • map_data
  • flash_data
  • priorities
  • visible
  • ox
  • oy
  • Notes
  1. Game Library
  2. RGSS Built-in Classes

Tilemap

The class governing tilemaps.

PreviousTableNextTone

Last updated 1 year ago

Tilemaps are a specialized concept used in 2D game map displays, created internally from multiple sprites.

Superclass

Class Method

Tilemap.new([viewport])

Creates a Tilemap object. Specifies a Viewport () when necessary.

Methods

dispose

Frees the tilemap. If the tilemap has already been freed, does nothing.

disposed?

Returns TRUE if the tilemap has been freed.

viewport

update

Updates the autotile animation, etc. As a rule, this method is called once per frame.

Properties

tileset

autotiles[index]

map_data

flash_data

priorities

visible

The tilemap's visibility. If TRUE, the tilemap is visible.

ox

The X-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.

oy

The Y-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.

Notes

The Z-coordinate of each sprite used to create a tilemap is fixed at a specific value.

  1. Tiles with a priority of 0 always have a Z-coordinate of 0.

  2. Priority 1 tiles placed at the top edge of the screen have a Z-coordinate of 64.

  3. Every time the priority increases by 1 or the next tile down is selected, the Z-coordinate increases by 32.

  4. The Z-coordinate changes accordingly as the tilemap scrolls vertically.

Keep these rules in mind when setting the Z-coordinates of any map characters.

Gets the Viewport () specified when the tilemap was created.

Refers to the bitmap () used as a tileset.

Refers to the bitmap () used as an autotile with an index number from 0 to 6.

Refers to map data (). Defines a 3-dimensional array measuring [ horizontal size * vertical size * 3 ].

Refers to the flash data () 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).

Reference to the priority table (). Defines a 1-dimensional array containing elements corresponding to tile IDs.

Object
Viewport
Viewport
Bitmap
Bitmap
Table
Table
Table