Jump to content

rendering to canvas id

Design Build Play

Recommended Posts

what Pixi do is just creating the canvas object for you.
if you want to use your own canvas you need to specify the canvas element while creating pixi renderer.

suppose you have this canvas in your html document


<canvas id="myCanvas"  width="400" height="400"></canvas> 


you can tell Pixi to use it by calling



var myView = document.getElementById('myCanvas');var renderer = PIXI.autoDetectRenderer(400, 400, myView); 

instead of


var renderer = PIXI.autoDetectRenderer(400, 400); 



Link to comment
Share on other sites

  • 5 years later...
  • 5 months later...

Hi I tried using image.thumb.png.0611b5467fc8580ae4d00a425a5be89b.png but not much of a success.


I am trying to create an html input box so that i can take user inputs as pixi.js doesn't provide one!

So i tried to create a canvas along withy pixi app but the canvas shifts the rest of the view of the app:


which was earlier something like this:


Please help!

Link to comment
Share on other sites


That's thread of 2013 year and very old pixiJS version.

If you searched some more time you could stumble across modern PixiJS docs: http://pixijs.download/dev/docs/PIXI.Renderer.html and "view" parameter. 

Please, before you do that again, read the docs and wiki: https://github.com/pixijs/pixi.js/wiki, and next time specify PixiJS version that you are using, and don't bump 5 year old threads.


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.

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.


  • Recently Browsing   0 members

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