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 djbeatzzz · Jun 11, 2014 at 06:24 AM · full screen

How do I get an image to fullscreen?

I have attached this to my main camera but I am still not getting full screen. public class DooDoo : MonoBehaviour {

 public Texture backgroundTexture;
 
 void onGUI(){
     GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), backgroundTexture);
     }

}

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by zharik86 · Jun 11, 2014 at 06:27 AM

Adding ScaleMode in your code in function GUI.DrawTexture():

  public Texture backgroundTexture;
 
  void onGUI(){
   GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), backgroundTexture, ScaleMode.StretchToFill);
  }
Comment
Add comment · Show 5 · 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 djbeatzzz · Jun 12, 2014 at 01:25 AM 0
Share

Thank You. It stretched the image but there is some blue screen left over.

avatar image djbeatzzz · Jun 12, 2014 at 01:33 AM 0
Share

Also the image is blurry. Any way to fix this?

avatar image FrankStarsKo · Jun 12, 2014 at 01:39 AM 0
Share

why don't you use a plane's face and resize visually on game's tab?

avatar image zharik86 · Jun 12, 2014 at 05:44 AM 0
Share

@djbeatzzz About "blue screen left over" - it is possible at you a texture with the edge the transparent therefore (as I assume color in the camera blue) and it is visible partially blue color. The second: "image is blurry" - try to change in the Inspector of properties of import of a texture Type value to "GUI". Probably it will help. But don't forget that if you have a texture of 100x100 in size, and you expand it on 500x500, certainly it will look blurry.

avatar image djbeatzzz · Jun 12, 2014 at 11:01 PM 0
Share

Thank you all for the help.

avatar image
0

Answer by Xonatron · Nov 22, 2017 at 03:49 AM

Heads up it's OnGUI() not onGUI(). Note the capital "O".

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

26 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Colour of borders after build full screen 0 Answers

Setting Resolutions in game/checking windowed mode 1 Answer

How to Eliminate Monitor Artifacts When Loading Scene? 1 Answer

Is it possible to change between exclusive fullscreen and borderless fullscreen in-game? 2 Answers

Unity Player Crashes ONLY on Firefox after migration 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