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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by darkelfbg · May 28, 2013 at 08:23 AM · planeresizewindowedfull screen

Windowed game to fullscreen

Hi, For the past 1 to 2 months i have been making a simple child's games. Unity 4.0 Free . Building for windows.

The game is "2D"/Camera is static orthographic . The entire time during development i was building the game for Default screen width 1024 height 768 and i was testing on windowed. Now the game has to be in default Full screen. However all the images that i used for background(I have a plane) are with that size and when i switch to full screen it gets blurred as if with low quality. How do i make it that the background(plane) stay in the middle of the screen and not reside.(also the other objects)

I really do hope you can help me ;d.

Comment
Add comment · Show 1
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 IgorAherne · Feb 15, 2017 at 12:56 AM 0
Share

;d ;d ;d

2 Replies

· Add your reply
  • Sort: 
avatar image
8
Best Answer

Answer by jogidipen · May 28, 2013 at 07:39 PM

Create one script, apply it on main camera:

 public float orthographicSize = 5;
 public float aspect = 1.33333f;

 void Start()
 {
     Camera.main.projectionMatrix = Matrix4x4.Ortho(
             -orthographicSize * aspect, orthographicSize * aspect,
             -orthographicSize, orthographicSize,
             camera.nearClipPlane, camera.farClipPlane);
 }


Comment
Add comment · Show 7 · 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
avatar image darkelfbg · May 29, 2013 at 07:12 AM 0
Share

jogidipen Thank you very much for you answers. I didnt know about this. I did try with 1.333F my orthographic size is 5(dont know why i did this) but it does not have the right effect with 1.333F I will play around with the numbers. Again thank you very much

avatar image FSanders · Jun 26, 2015 at 09:40 AM 0
Share

How would I have to set this up for a 1050 * 1680 $$anonymous$$ainCamera? If I just paste your code, it distorts my game severely.

avatar image Danteneo · Sep 30, 2015 at 06:00 PM 0
Share

I had the same problem and that script solved it :) thank you very much :) I just had to tweak the values to fit my setup and it worked :)

avatar image Azbo · Mar 26, 2016 at 03:36 AM 0
Share

Thanks this script worked! Saved me quite a bit of hassle!

avatar image Olbaper · Dec 01, 2016 at 06:38 PM 0
Share

The script is notworking for me; it says, nearClipPlane annd farClipPlane cannot be found, if someone colud help me..

avatar image jogidipen Olbaper · Dec 02, 2016 at 09:35 AM 0
Share
  • $$anonymous$$ake sure You are using orthographic camera.

  • Use Camera.main.nearClipPlane, Camera.main.farClipPlane in place of camera.nearClipPlane, camera.farClipPlane.

  • $$anonymous$$ake sure you are using proper orthographic size and aspect ratio,

avatar image $$anonymous$$ jogidipen · Feb 15, 2017 at 12:51 AM 0
Share

$$anonymous$$ake sure you are using proper orthographic size and aspect ratio

what are the proper values? how do they change the solution?
avatar image
0

Answer by Graham-Dunnett · May 28, 2013 at 12:01 PM

Maybe set up a 1024x768 rect for the camera to draw into?

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

18 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

Related Questions

Fixed aspect ratio; window position 1 Answer

Switching Full Screen to Windowed messes up layering of cameras? 0 Answers

GUITexture size and full screen 1 Answer

How can I resize a plane? 1 Answer

Aspect ratio is incorrect after forcing windowed mode with CMD+F and then back to fullscreen 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