Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by AngryCSharpNerd · Sep 23, 2012 at 06:10 AM · alphatransparentopacity

How to make this image semi-transparent?

http://imgur.com/90dxV

This is suppose to be a "hurt" image, in that when your health falls at like 3 hearts or something, this will automatically appear. The problem that I have is that I have no clue on how to make this semi-transparent. I looked up a lot of places, and it said something about color.a and alpha and all that stuff. Is that what "Opacity" is? Also, how can I can stretch that image to screen width and height? I want to change the image's properties via script. I find some things that are very annoying on Unity that they can't just make a simple "Opacity: <1-100>" property.

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

3 Replies

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

Answer by kristercollin · Sep 24, 2012 at 07:44 AM

AngryCSharpNerd,

There are several ways of doing this, but the one I would most likely use (from what you've described) is to create a GUI Texture object that holds the image.

So, I'd start by creating the image using (Gimp/Photoshop/Paint/etc...) without any transparency, then bring it in as an asset in Unity. Select it, then go to the "GameObject" menu, select a GUI Texture (which will automatically create it with the right resolution, etc...) then you go to the inspector, select the Color segment and then change the Alpha value to what you'd like. Then, once that's done you can use a script to tell the image to appear and, because it's a GUI Texture, it will be viewed on top of everything else as desired.

To make it prettier, though, you can use a script to manually change the alpha value so that when the image is needed you can fade into it being there and increase/decrease it's opacity to reflect intensity.

Comment
Add comment · Show 1 · 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 Hybris · Sep 24, 2012 at 01:28 PM 0
Share

I wanted to say the same thing :D

avatar image
2

Answer by Eric5h5 · Sep 24, 2012 at 06:36 AM

Use a full-screen GUITexture (not OnGUI code) and set the alpha appropriately.

I find some things that are very annoying on Unity that they can't just make a simple "Opacity: <1-100>" property.

Well, except you can, for just about everything. But alpha is not 0-100, it's 0.0-1.0.

Comment
Add comment · Show 1 · 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 sumitbabucutevil · Dec 17, 2020 at 05:36 AM 0
Share

this it the right answer

avatar image
0

Answer by m5k · Sep 23, 2012 at 03:24 PM

Try using Photoshop or another solution to create a semi transparent png or create a dds with a grey alpha layer.

Comment
Add comment · Show 2 · 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 AngryCSharpNerd · Sep 23, 2012 at 03:26 PM 0
Share

Would you know how to do that for Paint.NET? I'm quite new at it and I'd need a tutorial.

avatar image fafase · Sep 24, 2012 at 04:13 AM 2
Share

Use Gimp if like most of us you have no money

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

15 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

Related Questions

transparent mode does not work at alpha=255 1 Answer

Object opacity/alpha? 1 Answer

Need help with opacity error 0 Answers

GUI.DrawTexture - Slightly Transparent? 1 Answer

Panel Opacity 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