Jump to content

Tileset rendering question


Squarew00t
 Share

Recommended Posts

Hello guys,

 

I found about about phaser a few days ago and i really like the simplicity and stuff, but let's get to my question:

I am trying to render a single Tile from a 64x64 Tileset image.

That's my code:

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, render: render });var set;function preload() {    game.load.image('ground_1x1', 'assets/tilemaps/level1.png');}function create() {	game.stage.backgroundColor = '#2d2d2d';	set = new Phaser.Tileset('ground_1x1', 0, 64, 64);}function render() {	set.draw(Phaser.context, 50, 50, 0);}

pretty simple, but it just doesn't draw anything.

 

Sorry if this question is stupid, I'm not sure whether Phaser.context is the correct context to draw to, thank you guys in advance

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...