Reposition fps graphic, randomize cycles button
This commit is contained in:
@@ -513,6 +513,14 @@ function redistributeCycles (points, oldCycleDuration, cycleDuration) {
|
||||
return points;
|
||||
}
|
||||
|
||||
function randomizeCycles (points, cycleDuration) {
|
||||
/* Assigns every point a new random cycle start */
|
||||
for (var i = 0; i < points.original.length; i++) {
|
||||
points.target[i][3] = randomInt(0, cycleDuration - 1);
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
/* DRAW FUNCTIONS */
|
||||
|
||||
function drawPolygon (polygon, points, counter, tweeningFns) {
|
||||
@@ -721,7 +729,8 @@ function loopStart () {
|
||||
};
|
||||
|
||||
fpsGraphic = new window.PIXI.Text('0', {font: '25px monospace', fill: 'yellow'});
|
||||
fpsGraphic.x = 0;
|
||||
fpsGraphic.anchor = new window.PIXI.Point(1, 0);
|
||||
fpsGraphic.x = screenWidth - 1;
|
||||
fpsGraphic.y = 0;
|
||||
|
||||
if (fpsEnabled) {
|
||||
@@ -899,6 +908,11 @@ window.onload = function () {
|
||||
toggleControls();
|
||||
}, false);
|
||||
|
||||
document.getElementById('randomize-cycles').addEventListener('click', function () {
|
||||
randomizeCycles(polygonPoints, cycleDuration);
|
||||
return false;
|
||||
}, false);
|
||||
|
||||
var timeRange, timeInput;
|
||||
timeRange = document.getElementsByName('timeRange')[0];
|
||||
timeRange.value = cycleDuration;
|
||||
|
||||
Reference in New Issue
Block a user