- Home /
Webplayer loading screen
Hello everyone, I'm a little stuck with customizing Unity webplayer's loading screen. The HTML code, generated by default, differs from code in docs. I cannot understand where to paste params - background, logo etc. I achieved three results - nothing changes, or unity asks to install webplayer or everything works, but in resolution 1920x100. Please, tell where to paste parameters. Here's the default code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity Web Player | Shop</title>
<script type='text/javascript' src='https://ssl-webplayer.unity3d.com/download_webplayer-
3.x/3.0/uo/jquery.min.js'></script>
<script type="text/javascript">
<!--
var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";
if (document.location.protocol == 'https:')
unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>');
-->
</script>
<script type="text/javascript">
<!--
var config = {
width: 960,
height: 600,
params: { enableDebugging:"0" }
};
config.params["disableContextMenu"] = true;
var u = new UnityObject2(config);
jQuery(function() {
var $missingScreen = jQuery("#unityPlayer").find(".missing");
var $brokenScreen = jQuery("#unityPlayer").find(".broken");
$missingScreen.hide();
$brokenScreen.hide();
u.observeProgress(function (progress) {
switch(progress.pluginStatus) {
case "broken":
$brokenScreen.find("a").click(function (e) {
e.stopPropagation();
e.preventDefault();
u.installPlugin();
return false;
});
$brokenScreen.show();
break;
case "missing":
$missingScreen.find("a").click(function (e) {
e.stopPropagation();
e.preventDefault();
u.installPlugin();
return false;
});
$missingScreen.show();
break;
case "installed":
$missingScreen.remove();
break;
case "first":
break;
}
});
u.initPlugin(jQuery("#unityPlayer")[0], "Shop.unity3d");
});
-->
</script>
<style type="text/css">
<!--
body {
font-family: Helvetica, Verdana, Arial, sans-serif;
background-color: white;
color: black;
text-align: center;
}
a:link, a:visited {
color: #000;
}
a:active, a:hover {
color: #666;
}
p.header {
font-size: small;
}
p.header span {
font-weight: bold;
}
p.footer {
font-size: x-small;
}
div.content {
margin: auto;
width: 960px;
}
div.broken,
div.missing {
margin: auto;
position: relative;
top: 50%;
width: 193px;
}
div.broken a,
div.missing a {
height: 63px;
position: relative;
top: -31px;
}
div.broken img,
div.missing img {
border-width: 0px;
}
div.broken {
display: none;
}
div#unityPlayer {
cursor: default;
height: 600px;
width: 960px;
}
-->
</style>
</head>
<body>
<p class="header"><span>Unity Web Player | </span>Shop</p>
<div class="content">
<div id="unityPlayer">
<div class="missing">
<a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
<img alt="Unity Web Player. Install now!"
src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" />
</a>
</div>
</div>
</div>
<p class="footer">« created with <a href="http://unity3d.com/unity/" title="Go to
unity3d.com">Unity</a> »</p>
</body>
</html>
Thanks in advance.
Answer by Graham-Dunnett · Nov 14, 2014 at 01:44 PM
The code here:
http://docs.unity3d.com/Manual/CustomizingtheUnityWebPlayerloadingscreen.html
shows you how to edit the params
variable. In your auto-generated script, that variable is set on line 22. Params
is basically a structure defined inside an open and close brace. So, just put a newline at the end of the open brace on line 22, put the close brace onto a new line, and then you have some code which is identical to the code in the documentation. Check out:
http://forum.unity3d.com/threads/web-player-help.235531/
if you need a worked out example.
Your answer
Follow this Question
Related Questions
How to show an image while waiting for the game to finish loading 0 Answers
How to check if loading from another level or game start? 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Logo image in Facebook Canvas increases loading time. 0 Answers
Not loading scene on build 1 Answer