Jump to content

Tiling Sprite can't loaded on canvas?


yanipra
 Share

Recommended Posts

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 :)

post-5440-0-15148700-1384334008.png

post-5440-0-94857000-1384334012_thumb.jp

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...