[ts] Rebuild artifacts.

This commit is contained in:
badlogic 2018-11-15 15:56:38 +01:00
parent 14a795e936
commit 44552cd809
9 changed files with 12012 additions and 12005 deletions

View File

@ -1808,6 +1808,7 @@ declare module spine {
width: number;
height: number;
};
fullScreenBackgroundColor: string;
success: (widget: SpinePlayer) => void;
error: (widget: SpinePlayer, msg: string) => void;
}

View File

@ -10197,6 +10197,8 @@ var spine;
config.alpha = false;
if (!config.backgroundColor)
config.backgroundColor = "#000000";
if (!config.fullScreenBackgroundColor)
config.fullScreenBackgroundColor = config.backgroundColor;
if (!config.premultipliedAlpha)
config.premultipliedAlpha = false;
if (!config.success)
@ -10430,9 +10432,12 @@ var spine;
requestAnimationFrame(function () { return _this.drawFrame(); });
var ctx = this.context;
var gl = ctx.gl;
var bg = new spine.Color().setFromString(this.config.backgroundColor);
var doc = document;
var isFullscreen = doc.fullscreenElement || doc.webkitFullscreenElement || doc.mozFullScreenElement || doc.msFullscreenElement;
var bg = new spine.Color().setFromString(isFullscreen ? this.config.fullScreenBackgroundColor : this.config.backgroundColor);
gl.clearColor(bg.r, bg.g, bg.b, bg.a);
gl.clear(gl.COLOR_BUFFER_BIT);
this.loadingScreen.backgroundColor.setFromColor(bg);
this.loadingScreen.draw(this.assetManager.isLoadingComplete());
if (this.assetManager.isLoadingComplete() && this.skeleton == null)
this.loadSkeleton();
@ -10669,18 +10674,15 @@ var spine;
handleHover();
}
});
var mouseOverChildren = false;
canvas.onmouseover = function (ev) {
mouseOverChildren = false;
};
canvas.onmouseout = function (ev) {
if (ev.relatedTarget == null) {
mouseOverChildren = false;
var mouseOverChildren = true;
document.addEventListener("mousemove", function (ev) {
if (ev instanceof MouseEvent) {
var rect = _this.playerControls.getBoundingClientRect();
var x = ev.clientX - rect.left;
var y = ev.clientY - rect.top;
mouseOverChildren = x >= 0 && x <= _this.playerControls.clientWidth && y >= 0 && y <= _this.playerControls.clientHeight;
}
else {
mouseOverChildren = isContained(_this.dom, ev.relatedTarget);
}
};
});
var cancelId = 0;
var handleHover = function () {
if (!_this.config.showControls)

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -25,6 +25,7 @@
background: black;
z-index: 10;
border-radius: 4px;
overflow: auto;
}
.spine-player-hidden {

View File

@ -25,6 +25,7 @@ body {
animations: ["walk", "jump"],
controlBones: ["root"],
backgroundColor: "#cccccc",
fullScreenBackgroundColor: "#cc0000",
showControls: false,
});
</script>

View File

@ -95,6 +95,9 @@
height: number
}
/* Optional: the background color used in fullscreen mode. Must be given in the format #rrggbbaa. Default: backgroundColor. */
fullScreenBackgroundColor: string
/* Optional: callback when the widget and its assets have been successfully loaded. */
success: (widget: SpinePlayer) => void
@ -268,6 +271,7 @@
if (!config.atlasUrl) throw new Error("Please specify the URL of the atlas file.");
if (!config.alpha) config.alpha = false;
if (!config.backgroundColor) config.backgroundColor = "#000000";
if (!config.fullScreenBackgroundColor) config.fullScreenBackgroundColor = config.backgroundColor;
if (!config.premultipliedAlpha) config.premultipliedAlpha = false;
if (!config.success) config.success = (widget) => {};
if (!config.error) config.error = (widget, msg) => {};
@ -398,8 +402,6 @@
this.showSettingsDialog();
}
let oldCanvasWidth = 0;
let oldCanvasHeight = 0;
fullscreenButton.onclick = () => {
let doc = document as any;
if(doc.fullscreenElement || doc.webkitFullscreenElement || doc.mozFullScreenElement || doc.msFullscreenElement) {
@ -407,15 +409,12 @@
else if (doc.mozCancelFullScreen) doc.mozCancelFullScreen();
else if (doc.webkitExitFullscreen) doc.webkitExitFullscreen()
else if (doc.msExitFullscreen) doc.msExitFullscreen();
} else {
let player = dom as any;
if (player.requestFullscreen) player.requestFullscreen();
else if (player.webkitRequestFullScreen) player.webkitRequestFullScreen();
else if (player.mozRequestFullScreen) player.mozRequestFullScreen();
else if (player.msRequestFullscreen) player.msRequestFullscreen();
oldCanvasWidth = this.canvas.width;
oldCanvasHeight = this.canvas.height;
}
};
@ -568,7 +567,9 @@
let gl = ctx.gl;
// Clear the viewport
let bg = new Color().setFromString(this.config.backgroundColor);
var doc = document as any;
var isFullscreen = doc.fullscreenElement || doc.webkitFullscreenElement || doc.mozFullScreenElement || doc.msFullscreenElement;
let bg = new Color().setFromString(isFullscreen ? this.config.fullScreenBackgroundColor : this.config.backgroundColor);
gl.clearColor(bg.r, bg.g, bg.b, bg.a);
gl.clear(gl.COLOR_BUFFER_BIT);