2013-05-06 78 views
0

我正在使用http://canvasengine.net/進行網頁遊戲。畫布引擎:繪製等軸測圖

我試圖從我用軟件http://www.mapeditor.org/創建的JSON文件生成等軸測圖。

引擎和軟件是兼容的。

所以,我有這樣一個JSON文件:

{ "height":5, 
"layers":[ 
     { 
     "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 
     "height":5, 
     "name":"Calque de Tile 1", 
     "opacity":1, 
     "type":"tilelayer", 
     "visible":true, 
     "width":5, 
     "x":0, 
     "y":0 
     }], 
"orientation":"isometric", 
"properties": 
    { 

    }, 
"tileheight":41, 
"tilesets":[ 
     { 
     "firstgid":1, 
     "image":"..\/..\/..\/wamp\/www\/Symfony\/src\/Dontdie\/MapBundle\/Resources\/public\/images\/herbe.png", 
     "imageheight":41, 
     "imagewidth":82, 
     "margin":0, 
     "name":"herbe", 
     "properties": 
      { 

      }, 
     "spacing":0, 
     "tileheight":41, 
     "tilewidth":82 
     }], 
"tilewidth":82, 
"version":1, 
"width":5 
} 

後,我包括的js文件與canvasengine:

var url = "{{ asset('bundles/dontdiemap_temp/images/map.json') }}"; 
    var canvas = CE.defines("canvas_id"). 
     extend(Tiled). 
     ready(function() { 
      canvas.Scene.call("MyScene"); 
     }); 

    canvas.Scene.new({ 
     name: "MyScene", 
     materials: { 
      images: { 
       herbe: "{{ asset('bundles/dontdiemap_temp/images/herbe.png') }}" 
      } 
     }, 
     ready: function(stage) { 
      var el = this.createElement(); 
      var tiled = canvas.Tiled.new(); 
      tiled.load(this, el, url); 
      tiled.ready(function() { 
       var tile_w = this.getTileWidth(), 
        tile_h = this.getTileHeight(), 
        layer_object = this.getLayerObject(); 
       stage.append(el); 
      }); 

     } 
    }); 

而現在,我有一個問題。 Lokk因爲這屏幕:

Screen off my map

瓷磚不要堆放,因爲它應該在等距但就像一個2D法線貼圖。

你有什麼想法嗎?謝謝 !

回答