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 Triqy · Mar 22, 2013 at 04:16 AM · guibuttoncolorguitexturealpha

guiTexture color half alpha White?

So i have a guiTexture that needs to be half Transparent. Like half see through, but not all the way clear... Any ideas? This is what I have so far in JS...

 #pragma strict
 
 static var CanMove = false;
 static var ShowGUI = false;
 //var Click1Sound: GameObject;
 
 function Start () {
 
 CanMove = true;
 ShowGUI = true;
 
 }
 
 function Update () {
 
 if(ShowGUI == true ){
 
 
 guiTexture.enabled = true;
 
 
 }else{
 
 guiTexture.enabled = false;
 
 }
 
 
 if(CanMove == true){
 
 if(Input.touchCount > 0 ){
 
 for(var i : int = 0; i < Input.touchCount; i++){
 
 var touch : Touch = Input.GetTouch(i);
 
 if(touch.phase == TouchPhase.Began &&
 guiTexture.HitTest(touch.position)){
 
 
 
 CameraCUSTOM_Movement.MoveRight = true;
 
 }
 }
 }else{
 
 // this makes it all the way clear, but I want it to be half way
 
 guiTexture.color.a = 0;
 
 //////////////////////////////////////////////////////////////////
 
 
 CameraCUSTOM_Movement.MoveRight = false;
 
 }
 }
 }



Thanks- :)

Comment
Add comment · Show 7
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 robertbu · Mar 22, 2013 at 04:39 AM 2
Share

guiTexture.color.a = 0.5;

avatar image Triqy · Mar 22, 2013 at 04:49 AM 0
Share

I have already tried that and it does not work for some reason..

avatar image Loius · Mar 22, 2013 at 04:51 AM 0
Share

"does not work" does not help anyone help you.

avatar image Triqy · Mar 22, 2013 at 05:15 AM 0
Share

I have tried guiTexture.color.a = 0.5; and when I play it in the editor it looks the same as it would if it were guiTexture.color.a = 1;. I am not sure if the alpha is just a Int. rather than a float.

All I am trying to do is make the GUI half way transparent when it's not being touched, but when I touch it, it is fully view able.

avatar image robertbu · Mar 22, 2013 at 05:18 AM 1
Share

You are talking about a GUITexture? It is working fine for me. Start with a brand new GUITexture. Drop in your texture of choice. Then add this simple script:

 function Start () {
     var guitex : GUITexture  = GetComponent(GUITexture);
     guitex.color.a = 0.25;
 }
Show more comments

1 Reply

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

Answer by Triqy · Mar 22, 2013 at 05:24 AM

Oh ok. I didn't think to use GetComponent... Thanks it's working! You answered my question like a Boss. Cheers :)

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

Cannot set UnityUI.Image opacity when place on a UnityUI.Button 2 Answers

GUI.DrawTexture on GUI.Button press 1 Answer

(For Loop) Converting Gui Button to GuiText & GuiTexture 1 Answer

Making GUI Buttons on a GUI Texture 1 Answer

How to have correct color on imGUI Buttons (as dynamic textures) avoiding multiply effect ? 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