[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; width: number;
height: number; height: number;
}; };
fullScreenBackgroundColor: string;
success: (widget: SpinePlayer) => void; success: (widget: SpinePlayer) => void;
error: (widget: SpinePlayer, msg: string) => void; error: (widget: SpinePlayer, msg: string) => void;
} }

View File

@ -10197,6 +10197,8 @@ var spine;
config.alpha = false; config.alpha = false;
if (!config.backgroundColor) if (!config.backgroundColor)
config.backgroundColor = "#000000"; config.backgroundColor = "#000000";
if (!config.fullScreenBackgroundColor)
config.fullScreenBackgroundColor = config.backgroundColor;
if (!config.premultipliedAlpha) if (!config.premultipliedAlpha)
config.premultipliedAlpha = false; config.premultipliedAlpha = false;
if (!config.success) if (!config.success)
@ -10430,9 +10432,12 @@ var spine;
requestAnimationFrame(function () { return _this.drawFrame(); }); requestAnimationFrame(function () { return _this.drawFrame(); });
var ctx = this.context; var ctx = this.context;
var gl = ctx.gl; 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.clearColor(bg.r, bg.g, bg.b, bg.a);
gl.clear(gl.COLOR_BUFFER_BIT); gl.clear(gl.COLOR_BUFFER_BIT);
this.loadingScreen.backgroundColor.setFromColor(bg);
this.loadingScreen.draw(this.assetManager.isLoadingComplete()); this.loadingScreen.draw(this.assetManager.isLoadingComplete());
if (this.assetManager.isLoadingComplete() && this.skeleton == null) if (this.assetManager.isLoadingComplete() && this.skeleton == null)
this.loadSkeleton(); this.loadSkeleton();
@ -10669,18 +10674,15 @@ var spine;
handleHover(); handleHover();
} }
}); });
var mouseOverChildren = false; var mouseOverChildren = true;
canvas.onmouseover = function (ev) { document.addEventListener("mousemove", function (ev) {
mouseOverChildren = false; if (ev instanceof MouseEvent) {
}; var rect = _this.playerControls.getBoundingClientRect();
canvas.onmouseout = function (ev) { var x = ev.clientX - rect.left;
if (ev.relatedTarget == null) { var y = ev.clientY - rect.top;
mouseOverChildren = false; mouseOverChildren = x >= 0 && x <= _this.playerControls.clientWidth && y >= 0 && y <= _this.playerControls.clientHeight;
} }
else { });
mouseOverChildren = isContained(_this.dom, ev.relatedTarget);
}
};
var cancelId = 0; var cancelId = 0;
var handleHover = function () { var handleHover = function () {
if (!_this.config.showControls) 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; background: black;
z-index: 10; z-index: 10;
border-radius: 4px; border-radius: 4px;
overflow: auto;
} }
.spine-player-hidden { .spine-player-hidden {

View File

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

View File

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