fengFanYong Posted November 23, 2016 Share Posted November 23, 2016 i create a sprite,and set it width != height;i create graphics as the sprite children,but if i user graphics.drawCircle draw circle,it will draw Ellipse; code : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>text drawCircle</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.2.2/pixi.min.js"></script> <style> *{ margin: 0; padding: 0; } </style> </head> <body> <script> var stage = new PIXI.Container; var renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight, {antialias: true}); document.body.appendChild(renderer.view); requestAnimationFrame(update); var sp = new PIXI.Sprite(); sp.position.x = 100; sp.position.y = 100; sp.width = 200; sp.height = 400; g = new PIXI.Graphics(); g.beginFill(0x123123); g.drawCircle(.5,.5,.5); g.endFill(); sp.addChild(g); stage.addChild(sp); function update(){ renderer.render(stage); requestAnimationFrame(update); } </script> </body> </html> can i draw circle use graphics.drawCircle? 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.