Created
May 28, 2015 21:38
-
-
Save asfktz/023a5c3d1dc6492b1ac6 to your computer and use it in GitHub Desktop.
PIXI Arc loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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