framework update
@@ -421,6 +421,8 @@ class Renderer
421
421
mirrorX = false;
422
422
mirrorY = false;
423
423
424
defaultAnimationSpeed = 1;
425
424
426
cycle = null;
425
427
426
428
visible = true;
@@ -531,13 +533,18 @@ class Renderer
531
533
);
532
534
}
533
535
534
get currentAnimation()
536
get currentAnimationName()
535
537
{
536
538
return this.cycle? this.cycle.label : null;
537
539
}
538
540
539
541
setAnimation(label, defaultIndex = 0, cycleSpeed = -1)
540
542
{
543
if(cycleSpeed < 0)
544
{
545
cycleSpeed = this.defaultAnimationSpeed;
546
}
547
541
548
if(this.cycle)
542
549
{
543
550
if(this.cycle.label == label)
@@ -878,6 +885,11 @@ Math.clamp = function(number, min, max)
878
885
return Math.min(max, Math.max(min, number));
879
886
}
880
887
888
Math.randomRange = function(min, max)
889
{
890
return min + (Math.random() * (max - min));
891
}
892
881
893
Array.prototype.random = function ()
882
894
{
883
895
return this[Math.floor((Math.random()*this.length))];
@@ -421,6 +421,8 @@ class Renderer421
mirrorX = false;421
mirrorX = false;422
mirrorY = false;422
mirrorY = false;423
423
424
defaultAnimationSpeed = 1;425
424
cycle = null;426
cycle = null;425
427
426
visible = true;428
visible = true;@@ -531,13 +533,18 @@ class Renderer531
);533
);532
}534
}533
535
534
get currentAnimation()536
get currentAnimationName()535
{537
{536
return this.cycle? this.cycle.label : null;538
return this.cycle? this.cycle.label : null;537
}539
}538
540
539
setAnimation(label, defaultIndex = 0, cycleSpeed = -1) 541
setAnimation(label, defaultIndex = 0, cycleSpeed = -1) 540
{542
{543
if(cycleSpeed < 0)544
{545
cycleSpeed = this.defaultAnimationSpeed;546
}547
541
if(this.cycle) 548
if(this.cycle) 542
{549
{543
if(this.cycle.label == label) 550
if(this.cycle.label == label) @@ -878,6 +885,11 @@ Math.clamp = function(number, min, max)878
return Math.min(max, Math.max(min, number));885
return Math.min(max, Math.max(min, number));879
}886
}880
887
888
Math.randomRange = function(min, max)889
{890
return min + (Math.random() * (max - min));891
}892
881
Array.prototype.random = function () 893
Array.prototype.random = function () 882
{894
{883
return this[Math.floor((Math.random()*this.length))];895
return this[Math.floor((Math.random()*this.length))];