Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SirBedlam · Apr 03, 2015 at 03:19 PM · webplayerresolutioncustomhtmlloading screen

Web Player Dimensions and Custom Loading Screen Issue

I'm trying to set up my game's Web Player HTML file so that it will use a custom loading screen, but also fill the entire browser window (not use any pre-set resolution). So far I've been able to accomplish both of these, but not together. I'm not very experienced with HTML yet, so this is really stumping me.

I know that in order to fill the entire window and remove all pre-set dimensions, one needs to replace all said dimensions in the HTML file with "100%", and add a couple of extra lines. I'm able to do this just fine, as well as create my custom loading screen (I do have Pro).

The problem is that when combining these dimension properties with the chunk of example code I've found online for custom loading screens, it either breaks the game and tells me I need to download the Unity Web Player, or does what it's currently doing; displaying the custom loading screen, but with the game in the upper left corner of the browser window, still maintaining its dimensions.

I suspect this is because of the line: unityObject.embedUnity("unityPlayer", "Test.unity3d", 960, 540, params); EDIT: If this is really the only thing causing the problem, then what would these two numbers need to be changed to? Does this portion of the code need to be changed completely?

But changing the width and height to "100%" here just messes up the Web Player and tells me that I need to go download it.

No matter how I arrange the code, these two just don't seem to play well together. Is it even possible to do this, or will I just have to choose one over the other?

Here's my HTML file. My apologies if it's a bit messy, as I said, I'm not very experienced with HTML just yet.

     <!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 | Test</title>
         <script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
         <script type="text/javascript">
         <!--
             function GetUnity() {
                 if (typeof unityObject != "undefined") {
                     return unityObject.getObjectById("unityPlayer");
                 }
                 return null;
             }
            
             var params = {
             backgroundcolor: "aeaeae",
             bordercolor: "000000",
             textcolor: "FFFFFF",
             logoimage: "loading_title.png",
             progressbarimage: "loading_bar_fill.png",
             progressframeimage: "loading_bar_frame.png"
             };
            
             if (typeof unityObject != "undefined") {
                 unityObject.embedUnity("unityPlayer", "Test.unity3d", 960, 540, params);
                
             }
             -->
             </script>
             <style type="text/css">
             <!--
             var config = {
                 width: window.innerWidth, 
                 height: window.innerHeight,
                 params: { enableDebugging:"0" }
                 
             };
         -->
         </script>
         <style type="text/css">
         <!--
         body {
             font-family: Helvetica, Verdana, Arial, sans-serif;
             background-color: white;
             color: black;
             text-align: center;
             margin:0px;
             padding:0px;
             width:100%;
             height:100%;
         }
         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: 100%;
             height:100%;
         }
         div.missing {
             margin: auto;
             position: relative;
             top: 50%;
             width: 193px;
         }
         div.missing a {
             height: 63px;
             position: relative;
             top: -31px;
         }
         div.missing img {
             border-width: 0px;
         }
         div#unityPlayer {
             cursor: default;
             height: 100%;
             width: 100%;
         }
 
         embed
         {
             width:100% !important;
         }
         -->
         </style>
     </head>
     <body>
         <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>
     </body>
 </html>

If this is possible to achieve, how could I get it working? Any help would be greatly appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Web Player - Custom Loading Screen - PC 1 Answer

custom webplayer not building project 0 Answers

Webplayer templates custom tags (and the player settings GUI) 0 Answers

Overlay Webplayer With Video Ad 1 Answer

Using web players in different browsers 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges