espace Posted July 6, 2016 Share Posted July 6, 2016 //text.js above main.js in my index.html var e = function() { var style = { font : ' 36px Luckiest Guy', fill : '#F7EDCA', dropShadowColor : '#000000', dropShadowAngle : Math.PI / 6, dropShadowDistance : 6, //wordWrap : true, //wordWrapWidth : 1000, //LineHeight : 4, }; e.body = new PIXI.Text('level ',style) e.body.anchor.x=.5 e.body.anchor.y=.5 e.body.x=50 e.body.y=100 } //main.js below text.js in my index.html var stage = new PIXI.Container(); var interactive=true stage.interactive =true ; // create a renderer instance var renderer = PIXI.autoDetectRenderer(320, 480); // add the renderer view element to the DOM document.body.appendChild(renderer.view); requestAnimationFrame( animate ); var hud = e() stage.addChild(hud); function animate() { requestAnimationFrame( animate ); // render the stage renderer.render(stage); } Hi, i don't knwo how to set correctly my text.js to be used as a OOP object. I can't see my text who is hud in my main.js....why ? I take the example of a text but it could be a rectangle or something else... Thanks for your response. 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.