The game object class for a map. It contains scrolling and passage determination functions.
Methods
- Get the adjusted x value
Name Type Description x
number The x to adjust Returns:
Type Description number The adjusted x value - Get the adjusted y value
Name Type Description y
number The y to adjust Returns:
Type Description number The adjusted y value airship()Game_Vehicle
- Get the airship vehicle
Returns:
Type Description Game_Vehicle The airship object - Get the tiles at the given coordinates
Name Type Description x
number The x coordinate y
number The y coordinate Returns:
Type Description Array The tiles at the coordinates - Autoplays map audio
- Get autorun common events
Returns:
Type Description Array Array of autorunning common events - Get the autotile type at the given coordinates
Name Type Description x
number The x coordinate y
number The y coordinate z
number The z index of the tile Returns:
Type Description number The autotile type - Get the battleback 1 image file name
Returns:
Type Description string The battleback 1 name - Get the battleback 2 image file name
Returns:
Type Description string The battleback 2 name - Get the boat vehicle
Returns:
Type Description Game_Vehicle The boat object - Get the bush depth
- Since:
- Version 1.5.0
Returns:
Type Description number The bush depth - Get map x from canvas x
Name Type Description x
number The x value to convert Returns:
Type Description number The map x - Get map y from canvas y
Name Type Description y
number The y value to convert Returns:
Type Description number The map y - Changes the battleback images
Name Type Description battleback1Name
string The filename of the battle back 1 image battleback2Name
string The filename of the battle back 2 image - Changes the parallax image
Name Type Description name
string The filename of the parallax image loopX
boolean If the parallax loops horizontally loopY
boolean If the parallax loops vertically sx
number The horziontal scroll of the parallax sy
number The vertical scroll of the parallax - Changes the tileset by id
Name Type Description tilesetId
number The new tileset id - Check the layered tile flags
Name Type Description x
number The x coordinate to check y
number The y coordinate to check bit
number The bit to perform bitwise AND operation on with the tile Returns:
Type Description boolean True if a layered tile flag exists - Check the passage of the tile at the given coordinates
Name Type Description x
number The x coordinate to check y
number The y coordinate to check bit
number The bit to perform bitwise AND operation on with the tile Returns:
Type Description boolean True if passage allowed - Creates the vehicles
- Get the map data
Returns:
Type Description Array The map data - Get the delta between two x values
Name Type Description x1
number The first x value x2
number The second x value Returns:
Type Description number The delta between the x values - Get the delta between two y values
Name Type Description y1
number The first y value y2
number The second y value Returns:
Type Description number The delta between the y values - Disables name display
- Get the map display name
Returns:
Type Description string The display name - Get the display x
Returns:
Type Description number The display x - Get the display y
Returns:
Type Description number The display y - Get the distance between two sets of x/y coordinates
Name Type Description x1
number The first x value y1
number The first y value x2
number The second x value y2
number The second y value Returns:
Type Description number The distance - Perform the scroll
Name Type Description direction
number The direction to scroll distance
number The distance to scroll - Enables name display
- Get the map encounter list
Returns:
Type Description Array The encounter list - Get the map encounter step
Returns:
Type Description number The encounter step - Erase an event by id
Name Type Description eventId
number The id of the event to erase event(eventId)Game_Event
- Get an event by id
Name Type Description eventId
number The id of the event to get Returns:
Type Description Game_Event The event object - Get the event id at the given coordinates
Name Type Description x
number The x coordinate to check for events y
number The y coordinate to check for events Returns:
Type Description number The event id events()Array.<Game_Event>
- Get the events
Returns:
Type Description Array.<Game_Event> The array of map events eventsXy(x, y)Array.<Game_Event>
- Get events at the given coordinates
Name Type Description x
number The x coordinate to check for events y
number The y coordinate to check for events Returns:
Type Description Array.<Game_Event> The events at the given coordinates eventsXyNt(x, y)Array.<Game_Event>
- Get no-through events at the given coordinates
Name Type Description x
number The x coordinate to check for events y
number The y coordinate to check for events Returns:
Type Description Array.<Game_Event> The NT events at the given coordinates - Get the map height
Returns:
Type Description number The height - Initialize the map class
- Check if the airship can land at the given coordinates
Name Type Description x
number The x coordinate y
number The y coordinate Returns:
Type Description boolean True if landing is ok - Check if any events are starting
Returns:
Type Description boolean True if any event is starting - Check if the map is passable for the boat
Name Type Description x
number The x coordinate y
number The y coordinate Returns:
Type Description boolean True if passable - Check if the tile is a bush
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description boolean True if the tile is a bush - Check if the tile is a counter
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description boolean True if the tile is a counter - Check if the tile is a damage floor
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description boolean True if the tile is a damage floor - Check if dashing is disabled
Returns:
Type Description boolean True if dashing disabled - Check if events are running
Returns:
Type Description boolean True if event is running - Check if the tile is a ladder
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description boolean True if the tile is a ladder - Check if the map loops horizontally
Returns:
Type Description boolean True if the map loops horizontally - Check if the map loops vertically
Returns:
Type Description boolean True if the map loops vertically - Check if the map has an enabled display name
Returns:
Type Description boolean True if name display is enabled - Check if the map is an overworld type
Returns:
Type Description boolean True if overworld type - Check if the map is passable
Name Type Description x
number The x coordinate y
number The y coordinate d
number The direction to check Returns:
Type Description boolean True if passable - Check if the map is scrolling
Returns:
Type Description boolean True if scrolling - Check if the map is passable for the ship
Name Type Description x
number The x coordinate y
number The y coordinate Returns:
Type Description boolean True if passable - Check if the x/y coordinates given are valid
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description boolean True if the coordinates are within the map bounds - Get the layered tiles at the given coordinates
Name Type Description x
number The x coordinate y
number The y coordinate Returns:
Type Description Array The tiles at the coordinates - Get the map id
Returns:
Type Description number The map id - Get the parallax image file name
Returns:
Type Description string The parallax name - Get the parallax origin x
Returns:
Type Description number The parallax origin x - Get the parallax origin y
Returns:
Type Description number The parallax origin y - Get parallel common events
Returns:
Type Description Array Array of parallel common events - Refreshes the vehicles
- Refresh the map
- Refresh the map only if needed
- Refresh tile events
- Get the region id of a tile
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description number The region id of the tile - Request a map refresh
- Get the rounded x value
Name Type Description x
number The x to round Returns:
Type Description number The rounded x value - Get the rounded x value with direction
Name Type Description x
number The original x value d
number The direction Returns:
Type Description number The x value after direction accounted for - Get the rounded y value
Name Type Description y
number The y to round Returns:
Type Description number The rounded y value - Get the rounded y value with direction
Name Type Description y
number The original y value d
number The direction Returns:
Type Description number The y value after direction accounted for - Get the screen tile x
Returns:
Type Description number The screen tile x - Get the screen tile y
Returns:
Type Description number The screen tile y - Get the distance to scroll
Returns:
Type Description number The distance to scroll - Scrolls the map down
Name Type Description distance
number The distance to scroll - Scrolls the map left
Name Type Description distance
number The distance to scroll - Scrolls the map right
Name Type Description distance
number The distance to scroll - Scrolls the map up
Name Type Description distance
number The distance to scroll - Set up the display position
Name Type Description x
number The x coordinate y
number The y coordinate - Sets up the map for the given map id
Name Type Description mapId
number The map id to setup Throws:
Error if map data object is not available - Sets up an autorun common event
Returns:
Type Description boolean True if event set up - Set up the map battlebacks
- Set up events on the map
- Set up the map parallax
- Set up the map scroll
- Sets up a starting event
Returns:
Type Description boolean True if event set up - Sets up a starting map event
Returns:
Type Description boolean True if event set up - Sets up a test event
Returns:
Type Description boolean True if event set up - Get the ship vehicle
Returns:
Type Description Game_Vehicle The ship object - Start a map scroll
Name Type Description direction
number The direction of the scroll distance
number The distance of the scroll speed
number The speed of the scroll - Get the terrain tag of a tile
Name Type Description x
number The x coordinate to check y
number The y coordinate to check Returns:
Type Description number The terrain tag of the tile tileEventsXy(x, y)Array.<Game_Event>
- Get tile events at the given coordinates
Name Type Description x
number The x coordinate to check for events y
number The y coordinate to check for events Returns:
Type Description Array.<Game_Event> The tile events at the given coordinates - Get the height of a map tile in pixels
Returns:
Type Description number The height of one tile - Get the tile id by coordinate
Name Type Description x
number The x coordinate to check y
number The y coordinate to check z
number The z index of the tile Returns:
Type Description number The tile id - Get the width of a map tile in pixels
Returns:
Type Description number The width of one tile - Get the tileset object
Returns:
Type Description Object The tileset object - Get the tileset flags
Returns:
Type Description Array The tileset's flags - Get the tileset id
Returns:
Type Description number The tileset id - Unlock an event by id
Name Type Description eventId
number The id of the event to unlock - Update the map
Name Type Description sceneActive
boolean If the scene is active - Update events
- Update the interpreter
- Update the parallax
- Update the map scroll
- Update vehicles
vehicle(type)Game_Vehicle | null
- Get a vehicle by type
Name Type Description type
string|number Either string or number type of the vehicle (0/1/2 or boat/ship/airship) Returns:
Type Description Game_Vehicle|null The game vehicle object, or null if invalid type vehicles()Array.<Game_Vehicle>
- Get the vehicle array
Returns:
Type Description Array.<Game_Vehicle> Array of game vehicles - Get the map width
Returns:
Type Description number The width - Get the x value with direction
Name Type Description x
number The original x value d
number The direction Returns:
Type Description number The x value after direction accounted for - Get the y value with direction
Name Type Description y
number The original y value d
number The direction Returns:
Type Description number The y value after direction accounted for