Make a TilesMap fit canvas on phaser -


i'm trying phaser , created tiles map tiled "imported" on phaser.

everythign works fine, problem don't found how can fit tilesmap (wich 60px bigger canvas) canvas. looked exemples, found nothing @ all.

isn't job of function? layer.resizeworld()

var game = new phaser.game(800, 600, phaser.auto, '', { preload: preload, create: create, update: update, render: render }); var map; var tileset; var layer; var player; var cursors;     function preload() {     game.load.tilemap('map', 'assets/maps/map.json', null, phaser.tilemap.tiled_json);     game.load.image('tiles', 'assets/tiles/tilessheet.png'); }  function loadupdate(){ }  function create() {     map = game.add.tilemap('map');     map.addtilesetimage('tilessheet','tiles');     layerground = map.createlayer("ground");     layerobstacle = map.createlayer("obstacle");          //  un-comment on see collision tiles     // layer.debug = true;     layerground.resizeworld(); }  function update() { }  function render() { } 

layer.resizeworld() resize game world match size of tilemap. won't canvas object. whatever size give game in game constructor size canvas created , displayed at. in example above make 800x600 sized canvas.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -