Updated pixi.
Maybe fixed a case from interpolation that a sprite could not be cleaned up. Need to make a better system for controlling sprites. Added binds for arrow keys to scroll multiline text. Added support for colorto tween changing tint not just alpha.
This commit is contained in:
parent
2287163a34
commit
d356f17adb
6 changed files with 110 additions and 44 deletions
27
Js/Common.js
27
Js/Common.js
|
@ -158,11 +158,12 @@ class commonFunctions {
|
|||
let color = '';
|
||||
name = name.substring(1);
|
||||
if(name.length === 8) {
|
||||
color = name.slice(0, 6);
|
||||
alpha = name.slice(6, 8);
|
||||
color = parseInt(name.slice(0, 6), 16);
|
||||
alpha = parseInt(name.slice(6, 8), 16) / 255;
|
||||
} else {
|
||||
color = parseInt(name, 16);
|
||||
alpha = 1;
|
||||
}
|
||||
color = parseInt(color, 16);
|
||||
alpha = parseInt(alpha, 16) / 255;
|
||||
return { color, alpha };
|
||||
} else {
|
||||
switch(name.toLowerCase()) {
|
||||
|
@ -184,6 +185,15 @@ class commonFunctions {
|
|||
return [r/255, g/255, b/255];
|
||||
}
|
||||
|
||||
static componentToHex(c) {
|
||||
var hex = parseInt(c).toString(16);
|
||||
return hex.length == 1 ? "0" + hex : hex;
|
||||
}
|
||||
|
||||
static rgbToHex(rgb) {
|
||||
return `#${this.componentToHex(rgb[0] * 255)}${this.componentToHex(rgb[1]* 255)}${this.componentToHex(rgb[2]* 255)}`;
|
||||
}
|
||||
|
||||
static convertUtageTextTags(text) {
|
||||
text = text.replace(/<speed.*?>|<\/speed>/g, "");
|
||||
text = text.replace(/\\n/g, "<br/>")
|
||||
|
@ -317,6 +327,15 @@ class commonFunctions {
|
|||
}
|
||||
retval.speed = Number(retval.speed);
|
||||
}
|
||||
let indexC = props.indexOf("color=");
|
||||
if(indexC !== -1) {
|
||||
retval.color = "";
|
||||
for(let i = indexC + 6; i < props.length; ++i) {
|
||||
if(props[i] == " ") { break; }
|
||||
retval.color += props[i];
|
||||
}
|
||||
retval.color = retval.color;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue