Jump to content

TileSprite Bug or Noob Mistake?


Heppell08
 Share

Recommended Posts

So i was looking at parallax scrolling backdrops and want it in my game. I have 1 large backdrop image and it can be scrollable with edges meeting eachother to look seemless. When i load in the tilesprite i get a lovely message in console on chrome with this message:

   Phaser v1.1.3 - Renderer: WebGL - Audio: WebAudio     phaser.min.js:577WebGL: drawElements: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'. Or the texture is Float or Half Float type with linear filtering while OES_float_linear or OES_half_float_linear extension is not enabled. phaser.min.js:3

Also that 77 in there keeps going up. Any idea?

Link to comment
Share on other sites

  • 3 weeks later...

something really seems not to work with the tilesprites. First, WebGL don't like png, always get errors here, with jpg not.

 

also when i change the y-coordinate doesn't make a difference: 

 

tilesprite = game.add.tileSprite(0, 500, 480, 256, 'bg_01');

 

and 

 

game.add.tileSprite(0, 300, 480, 256, 'bg_01'); for example gives me the same output...

Link to comment
Share on other sites

  • 3 weeks later...

I'm struggling with this too, although this being my first foray into anything Phaser-related it's probably something I'm doing...

 

I have this:

var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload() {    game.load.image('ground', 'assets/Ground.jpg');}function create() {	bgGrd = game.add.tileSprite(0, 0, game.stage.bounds.width, 121, 'ground');}

and I just get a blank, black game area, no JS errors though. The tile is 121 x 121 - I didn't fully understand the comment about it having to have, "power-of-two dimensions" - maybe I misunderstood that bit?

 

Am I even close?!

 

Any help much appreciated,

Toby
 

Link to comment
Share on other sites

Just to say that TileSprites are now properly handled in 1.2. You can place them anywhere, fix them to the camera, even get input events off them.

 

For the meantime though Toby - I would suggest trying a power of 2 texture, which means a texture where the dimensions are a power of two (i.e. 16x16, 32x32, 64x64, 128x128, 256x256, etc). There are some in the examples assets folder if you need.

Link to comment
Share on other sites

For the meantime though Toby - I would suggest trying a power of 2 texture, which means a texture where the dimensions are a power of two (i.e. 16x16, 32x32, 64x64, 128x128, 256x256, etc). There are some in the examples assets folder if you need.

 

Thanks for that, much appreciated. I still don't quite get what's meant by 'a power of 2 texture' though, am I being thick?!

 

Do you mean a square tile where the side lengths are 2^x, where x is any integer? I though it meant the side lengths were x^2 (x to the 'power of 2'), but your examples don't fit that rule.

Toby

Link to comment
Share on other sites

Thanks for that, much appreciated. I still don't quite get what's meant by 'a power of 2 texture' though, am I being thick?!

 

Do you mean a square tile where the side lengths are 2^x, where x is any integer? I though it meant the side lengths were x^2 (x to the 'power of 2'), but your examples don't fit that rule.

Toby

 

Ok, I have it working, so thanks! It seems like any rectangle where side lengths are 2^x work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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