Version2.0/Maps

Last-modified: 2009-03-28 (土) 15:26:57
  • Map Map.new(image, mapfile, width, height, tileWidth, tileHeight)
    Create a new map by giving a map file
    image (Image): image which contains tiles
    mapfile (String): path to the map file (.map)
    width (Number): width of the map in tile
    height (Number): height of the map in tile
    tileWidth (Number): width of the tiles in pixel
    tileHeight (Number): height of the tiles in pixel
  • Void Map.destroy(map)
    Destroy a map
    map (Map): map to destroy
  • Void Map.draw(screen, map, x, y, width, height)
    Draw a map
    screen (Number): screen where to draw (SCREEN_UP or SCREEN_DOWN)
    map (Map): map to destroy
    x (Number): x-coordinate where to draw the map
    y (Number): y-coordinate where to draw the map
    width (Number): x number of tiles to draw
    height (Number): y number of tiles to draw
  • Void Map.scroll(map, x, y)
    Scroll a map
    map (Map): map to destroy
    x (Number): x number of tiles to scroll
    y (Number): y number of tiles to scroll
  • Void Map.space(map, x, y)
    Set the space between each tiles of a map
    map (Map): map to destroy
    x (Number): x space between tiles
    y (Number): y space between tiles
  • Void Map.setTile(map, x, y, tile)
    Change a tile value
    map (Map): map to destroy
    x (Number): x-coordinate of the tile to change in the map table
    y (Number): y-coordinate of the tile to change in the map table
    tile (Number): new tile value
  • Number Map.getTile(map, x, y, tile)
    Get a tile value
    map (Map): map to destroy
    x (Number): x-coordinate of the tile to get
    y (Number): y-coordinate of the tile to get