Improved handling for where to put character on screen if layer is not given.
Punch position uses the actual easing from utage now. Fix audio context not being able to be created without user input in some new browsers. Some changes for diva fades. Made ui image match games slightly more. Disabled select on text since you can't select it without triggering next anyways. Various other minor fixes.
This commit is contained in:
parent
6a4bb7a459
commit
3b91e57a1c
6 changed files with 219 additions and 94 deletions
23
Js/Common.js
23
Js/Common.js
|
@ -92,14 +92,24 @@ class commonFunctions {
|
|||
t = -0.45;
|
||||
}
|
||||
break;
|
||||
case "punch": {
|
||||
if (t === 0 || t === 1)
|
||||
return start;
|
||||
debugger;
|
||||
let change = end - start;
|
||||
let num = 0.3;
|
||||
let rad = Math.PI * 2;
|
||||
let num2 = num / rad * Math.asin(0);
|
||||
return change * Math.pow(2, -10 * t) * Math.sin((t * 1 - num2) * rad / num);
|
||||
}
|
||||
//http://www.gizma.com/easing/
|
||||
case "quadinout":
|
||||
var change = end - start;
|
||||
case "quadinout": {
|
||||
let change = end - start;
|
||||
t = t * 2;
|
||||
if (t < 1) { return change/2*t*t + start; }
|
||||
t--;
|
||||
return -change/2 * (t*(t-2) - 1) + start;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (1 - t) * start + t * end;
|
||||
//-(2*x-1)^4 +1
|
||||
|
@ -118,10 +128,9 @@ class commonFunctions {
|
|||
|
||||
static hexToRgb (hex) {
|
||||
hex = hex.toString(16);
|
||||
let bigint = parseInt(hex, 16);
|
||||
let r = (bigint >> 16) & 255;
|
||||
let g = (bigint >> 8) & 255;
|
||||
let b = bigint & 255;
|
||||
let r = (hex >> 16) & 255;
|
||||
let g = (hex >> 8) & 255;
|
||||
let b = hex & 255;
|
||||
return [r, g, b];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue