Skip to content

Instantly share code, notes, and snippets.

@asfktz
Created May 28, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asfktz/023a5c3d1dc6492b1ac6 to your computer and use it in GitHub Desktop.
Save asfktz/023a5c3d1dc6492b1ac6 to your computer and use it in GitHub Desktop.
PIXI Arc loop
/*globals PIXI */
'use strict'
var renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight, {
antialias: true,
view : document.getElementById('canvas'),
transparent: true
});
var stage = new PIXI.Container();
for (let i = 0, y = 4; i < y; i++) {
let graphics = new PIXI.Graphics();
graphics.lineStyle(3, 0x0000FF, 1);
graphics.beginFill(0xFF700B, 1);
graphics.fillAlpha = 0;
console.log(i);
let startAngle = Math.PI * (2 / y) * (i);
let endAngle = Math.PI * (2 / y) * (i + 1);
graphics.moveTo(100, 100)
graphics.arc(100,100, 100, startAngle, endAngle);
graphics.endFill()
graphics.x = 150;
graphics.y = 150;
graphics.scale.set(0.5)
stage.addChild(graphics);
}
renderer.render(stage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment