Unity Community


Results 1 to 9 of 9

  1. Posts
    22

    i need code for (Glow button) help me please

    hi all
    i want create a glow button see sample http://www.yourfilelink.com/get.php?fid=741366
    i have 2 image 1 image is normal(no glow button) and 1 image is gloweble button see sample



    now i want when mouse cursore is over gui texture or 3d plan morph image 1 to image 2 with (motion ing pong) format and i need code (java) and i want know i change opacity of texture with scripting is better or change alpha of gui texture.
    so
    ineed code for cliked on the button
    thanks


  2. Posts
    22

    more help for glowbutton(attach file)

    more help for glowbutton(attach file)
    Attached Images   


  3. Posts
    99
    just because of crapy sample video link i wont help you.
    No Image BBCode - NO SIGNATURE FOR YOU


  4. Location
    Places
    Posts
    371
    Can simply use a gui style. And in the normal put the first and in hover add in your glow..

    Then its as simple as
    Code:  
    1. void onGUI()
    2. {
    3.     if(GUI.Button(new Rect(50,50,40,20), myGUIStyle)
    4.     // do something
    5. }


  5. Posts
    22
    thanks
    so my buttons is a 3d object(plan) that code is for gui objects

    do you know how to change alpha value of a materials with script i want chang very slow.


  6. Location
    Brasil
    Posts
    207
    Quote Originally Posted by simanama View Post
    thanks
    so my buttons is a 3d object(plan) that code is for gui objects

    do you know how to change alpha value of a materials with script i want chang very slow.
    In C#
    Code:  
    1. Color c = myObject.renderer.material.color;
    2. c.a = 0.1F;  // Values between 0 and 1, 0 is completely transparent
    3. myObject.renderer.material.color = c;
    Last edited by dart; 01-01-2012 at 08:56 AM. Reason: Formart Code


  7. Posts
    22
    thanks but i work with java script can you help?
    write this code with java script please

  8. Director for Support



    Location
    Unity HQ/UK
    Posts
    1,412
    Code:  
    1. var c : Color = myObject.renderer.material.color;
    2. c.a = 0.1F;  // Values between 0 and 1, 0 is completely transparent
    3. myObject.renderer.material.color = c;

    I think the difference between c# and javascript is trivial. (Set variable to color, change alpha, assign back to material.)


  9. Posts
    22
    Quote Originally Posted by dendrophile View Post
    Code:  
    1. var c : Color = myObject.renderer.material.color;
    2. c.a = 0.1F;  // Values between 0 and 1, 0 is completely transparent
    3. myObject.renderer.material.color = c;

    I think the difference between c# and javascript is trivial. (Set variable to color, change alpha, assign back to material.)
    thanks

    see this is final button i want morph image 1(gallery no glow) to image 2(gallery with glow) when mouse cursor is on the plan(button)
    so this is an animation button(only change(animate) image(texthure of image i think must i create 2 plan , plan 2 is copy of plan 1 and i put 2 image on the 2 plan .
    image 1 to plan 1 and image 2 to plan 2 so
    when alpha value of material 1 changed of 1 to 0 (with delay time) , the alpha value of material 2 changed of 0 to 1(with delay time)
    this animation of button is loop(ping pong) when mouse cursor is over button.
    so these is 2 image:Name:  key 2.jpg
Views: 203
Size:  13.8 KBName:  key 1.jpg
Views: 201
Size:  13.5 KB

    see
    http://youtu.be/CWdki7YMQTU
    thanks to all lead
    this is link of button aniamtion http://www.youtube.com/watch?v=CWdki...ature=youtu.be
    Last edited by simanama; 01-02-2012 at 12:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •