From 3c5f7e5eca6316ce8f0ddfadebf9a5333ac81693 Mon Sep 17 00:00:00 2001 From: Nuno Miranda <38939683+nuno-miranda@users.noreply.github.com> Date: Fri, 16 Aug 2019 04:38:34 +0100 Subject: [PATCH] Libraria PixiJS (#27421) * Libraria PixiJS * missing extension * Update and rename guide/portuguese/canvas/PixiJS.md to guide/portuguese/canvas/pixijs/index.md --- guide/portuguese/canvas/pixijs/index.md | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 guide/portuguese/canvas/pixijs/index.md diff --git a/guide/portuguese/canvas/pixijs/index.md b/guide/portuguese/canvas/pixijs/index.md new file mode 100644 index 0000000000..bdb1507f89 --- /dev/null +++ b/guide/portuguese/canvas/pixijs/index.md @@ -0,0 +1,38 @@ +--- +title: PixiJS +localeTitle: PixiJS +--- +## Libraria PixiJS + +# Introdução + +O PixiJS é uma libraria em Javascript que permite efetuar a manipulação dos objectos 2D utilizando o WebGL através do uso do Canvas. + +# Exemplo de código + +Coelho rotativo +``` +var app = new PIXI.Application(800, 600, {backgroundColor : 0x1099bb}); +document.body.appendChild(app.view); + +// create a new Sprite from an image path +var bunny = PIXI.Sprite.fromImage('required/assets/basics/bunny.png') + +// center the sprite's anchor point +bunny.anchor.set(0.5); + +// move the sprite to the center of the screen +bunny.x = app.screen.width / 2; +bunny.y = app.screen.height / 2; + +app.stage.addChild(bunny); + +// Listen for animate update +app.ticker.add(function(delta) { + // just for fun, let's rotate mr rabbit a little + // delta is 1 if running at 100% performance + // creates frame-independent transformation + bunny.rotation += 0.1 * delta; +}); + +```