Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 question was closed Apr 10, 2016 at 04:06 PM by GameMaker_ for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by GameMaker_ · Apr 09, 2016 at 01:07 PM · guitexturetransparencybackground

transparent background with GUI.DrawTexture

Hi !

Sorry for my bad english, it is not my native language...

I want to display a texture with GUI.DrawTexture. This texture has transparency, but when I display it, the background (set to transparent thanks to PhotoFiltre) is displayed with white color (color without transparency). I thought I found the solution here: other topic, but the "GUI" texture type is not suggested in my texture inspector: there only is "Editor GUI and Legacy GUI". So I selected this one, with "trueColor" format as in the other topic, but it didn't work. In addition, it is written in the bottom of the inspector on the preview "RGB 24 bits". The only way I found to get "ARGB 32bits" is selecting "Advanced" texture type, and selecting "Alpha from grayscale". But of course, the alpha is according to Grayscale, and not to the source alpha channel...

Another way to solve this problem is to set a color as transparent, so that the background (color = (255,255,255)), is transparent, without caring about the source transparency. But I don't know how to do that...

Please help me ! Thx.

Comment
Add comment · Show 11
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 Cherno · Apr 09, 2016 at 01:39 PM 0
Share

Normally, you only need to import is as Legacy GUI. If the image has been saved as a PNG with it's transparency intact, it should show correctly when drawn with GUI.DrawTexture.

avatar image GameMaker_ Cherno · Apr 09, 2016 at 01:56 PM 0
Share

The problem is that with these parameters, it displays "RGB 24 bits" PreviewStone That means that the problem is not in scripting: even if it could, it would have no information to get alpha channel...

previewstone.png (16.1 kB)
avatar image Cherno GameMaker_ · Apr 09, 2016 at 07:37 PM 1
Share

I don't know about your Unity version, but I use the latest one and if I import a PNG image with transparency as Editor GUI and Legacy GUI, it reads "ARGB 32 bit" and the transparent area shows correctly in the preview (or rather, it doesn't show and the white-grey checkerboard background is visible).

If you view the file with an image viewer, does it show corretly with transparency intact?

Show more comments
Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to place/add a HD image/picture in background of my game? 0 Answers

background GUI texture 2 Answers

Changing Font, Background/Style of GUI Buttons 1 Answer

Creating a GUI Button background texture 2 Answers

Gui appear and then fade to black 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