yanipra Posted November 13, 2013 Share Posted November 13, 2013 Hi, All i'm newbie use pixi.js I have question, Why I can't to load this image with TilingSprite? I have source code like this<html> <head> <meta charset="UTF-8"> <title>Parallax Scrolling Demo</title> <style> body { background-color: #000000; } canvas { background-color: #222222; } </style> </head> <body onload="loaded();"> <div align="center"> <canvas id="game-canvas" width="1366" height="634"></canvas> </div> <script src="pixi.dev.js"></script> <script> function loaded() { stage = new PIXI.Stage(0x66FF99); renderer = new PIXI.autoDetectRenderer( 1366, 634, document.getElementById("game-canvas") ); var texture = PIXI.Texture.fromImage("background.jpg"); var sprite = new PIXI.Sprite(texture); stage.addChild(sprite); var coba = PIXI.Texture.fromImage("Awan.png"); cobaes = new PIXI.TilingSprite(coba, 512, 150); cobaes.position.x = 512; cobaes.position.y = 0; stage.addChild(cobaes); requestAnimFrame(update); } function update() { renderer.render(stage); requestAnimFrame(update); } </script> </body></html>I need suggest to solve my problem, Thank Quote Link to comment Share on other sites More sharing options...
benny! Posted November 13, 2013 Share Posted November 13, 2013 Do you access your script via a web server (e.g. Apache)? Quote Link to comment Share on other sites More sharing options...
xerver Posted November 13, 2013 Share Posted November 13, 2013 Does the image you are trying to tile have dimensions that are powers of 2? Quote Link to comment Share on other sites More sharing options...
yanipra Posted November 13, 2013 Author Share Posted November 13, 2013 Do you access your script via a web server (e.g. Apache)? yes i'm using apache to access it Quote Link to comment Share on other sites More sharing options...
yanipra Posted November 13, 2013 Author Share Posted November 13, 2013 Does the image you are trying to tile have dimensions that are powers of 2? oh yes, i know what you mean. thank xerver Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.