Tilemap Rendering is working :)
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 27 KiB |
@@ -105,4 +105,5 @@
|
||||
<script src="../src/tilemap/Tilemap.js"></script>
|
||||
<script src="../src/tilemap/TilemapLayer.js"></script>
|
||||
<script src="../src/tilemap/Tile.js"></script>
|
||||
<script src="../src/tilemap/TilemapRenderer.js"></script>
|
||||
|
||||
|
||||
@@ -26,6 +26,14 @@
|
||||
|
||||
}
|
||||
|
||||
var canvas;
|
||||
var context;
|
||||
var baseTexture;
|
||||
var texture;
|
||||
var s;
|
||||
var r;
|
||||
var t;
|
||||
|
||||
function create() {
|
||||
|
||||
// game, key, mapData, format, resizeWorld, tileWidth, tileHeight
|
||||
@@ -33,12 +41,17 @@
|
||||
// This creates the tilemap using the csv and tile sheet we loaded.
|
||||
// We tell it use to CSV format parser. The 16x16 are the tile sizes.
|
||||
// The 4th parameter (true) tells the game world to resize itself based on the map dimensions or not.
|
||||
var t = new Phaser.Tilemap(game, 'csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, true, 16, 16);
|
||||
|
||||
t = new Phaser.Tilemap(game, 'csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, true, 16, 16);
|
||||
|
||||
r = new Phaser.TilemapRenderer(game);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
r.render(t);
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
game.camera.x -= 4;
|
||||
|
||||