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 Zacharias3690 · Nov 23, 2012 at 08:02 PM · webplayerfacebook

How to resize webplayer depending on user resolu

I'm making a "2d" game in Unity and I'm implementing facebook. I'm almost finished, but the issue is lower resolution monitors can't see the entire game. I'd like to know if there's a way to zoom out (like ctrl + -) when their resolution is too low.

Comment
Add comment · Show 3
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
avatar image Montraydavis · Nov 23, 2012 at 09:14 PM 0
Share

Can't you actually do this with Javascript alone ? Or perhaps HT$$anonymous$$L, and use %'s as width .

avatar image Zacharias3690 · Nov 23, 2012 at 09:44 PM 0
Share

I looked into that, but the issue is if I make the webplayer bigger, it changes the size of the camera view as well, which means things are spread out more in the scene and causes issues with gameplay.

avatar image Montraydavis · Nov 23, 2012 at 09:46 PM 0
Share

Ah! Ouch. I did not know that the camera view changes when resized. That kind of sucks . . . Eh, I will do some searching, and respond if I do find something . . . Perhaps you could contact Unity3D directly on the issue ?

I bet there is a way, but, I have not a clue how to detect the players size in the html document :\

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Graham-Dunnett · Nov 24, 2012 at 10:06 PM

Set the size of the unity object to be a percentage of the page, and as the webpage is resized the web player will resize. You can detect the change in size using the pixelWidth and pixelHeight members of the camera class. Unity will assume it has to render to the whole space available to it. Use pixelRect to restrict rendering to a certain rectangle. If the window is made too small for the game, then don't render anything, and instead display a message saying the window needs to be a certain size for the game to work.

Comment
Add comment · Share
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

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

12 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

Related Questions

WWW POST request headers gone on webplayer facebook 1 Answer

Unity Web Player in Facebook: How to set the application name ? 1 Answer

Webplayer not recognized in IE and Facebook 1 Answer

Logo image in Facebook Canvas increases loading time. 0 Answers

Will a WebPlayer build that uses the Facebook SDK work when accessed directly on my own server? 0 Answers


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