Set Opacity Of Animations, Labels, Ui Buttons And Object Node - For B4 And Later Only

Discussion in 'BBNodes' started by LBPToo, Dec 1, 2018.

  1. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Price(FREE or PAID): FREE
    Node Name: Set Opacity
    Type of Node: Change Object Attributes
    Description: This node allows you to change the opacity of objects, labels and animations in the 3D World, plus buttons in the UI.
    Special Instructions: For Objects must set Material in 3D Model to Shadeless Transparent
    Author: @LBPToo
    Date Uploaded: 12-01-2018
    Last Update: 12-09-2018

    With this one node you can optionally set the opacity of any of your objects and/or labels, and/or animations, and/or UI Buttons. As an example of a likely use, you could connect it to and "if collide" node and if your character say runs into an enemy you can make it disappear, or become partially transparent. You could also say make an enemy 20 percent more transparent each time he gets hit and then when at 100% transparent dies. If you have an animation attached to your character you could make it disappear and leave the enemy, or if there was a label, you could do the same thing. Anyway, fool around with it and have fun. I did this more than anything so people that are not programmers could easy change opacity in their game without coding.

    Note: As a caveat that @particles reminded me of, transparency is typically processor intensive so you should limit your use of it, or at least be aware and watch for any negative performance impact.

    Here are the attributes and an explanation of each.

    https://drive.google.com/open?id=1iCkFnRuFJvI-0MEs7EOv_LpXZeogacsi
    Set Animation? - Check if you want to set the opacity of an animation.
    Ani Node Name - This is the name of your animation node.
    Animation Opacity - This is what sets the Opacity. 0.0(transparent) - 1.0(opaque)
    Set Label? - Check if you want to set a label's opacity.
    Label Node Name - The name of the label node.
    Label Opacity - This is what sets the Opacity. 0(transparent) - 255(opaque)
    Set Button? - Check if you want to set UI Button's opacity.
    Button Name - The name of the Button in the UI. Only sets the first button with this name. Code could be easily changed to set all buttons with this name.
    Button Opacity - This is what sets the Opacity. 0(transparent) - 255(opaque)

    Set Object? - Check if you want to set the opacity of the entity/object.
    Object Opacity - This is what sets the Opacity. - 0(transparent) - 255(opaque)
    New Object Color? - Check if you want to change the color of the object along with the opacity.
    New Color - Uses this color only if you checked New Object Color.

    Here is a bbasset that contains the Set Opacity node. I've also included a simple bbdoc to demo it in action. NOTE: This only works in BB3 beta 4 and later versions.
    NOTE: For objects you must set the Material in 3D Model to Shadeless Transparent.
    Another important note:
    To make an object disappear completely, you must both set the Object Opacity to "0" and check "New Object Color" and set all the "New Color" values to "0".

    *******************NEW Version 12/9/18 at 10:48 AM AZ Time*******************
     

    Attached Files:

    Last edited: Dec 9, 2018
    Jackps, Tom King, ZackGriset and 2 others like this.
  2. superfabiuz

    superfabiuz Boxer

    Joined:
    Nov 23, 2018
    Messages:
    19
    Likes Received:
    2
    Thanks!
     
  3. ZackGriset

    ZackGriset Moderator

    Joined:
    Oct 3, 2017
    Messages:
    252
    Likes Received:
    353
    Really awesome work man. This is great stuff!
     
  4. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Thanks Zack!
     

Share This Page