0 Favourites

How do I use the new set color in construct 3?

  • I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?

    SteamPoweredPix Hi, I was having the same exact problem - it really seemed as though effects that require color parameters were just broken in Construct 3, but they're not! Here's how pass color values to effects now.

    Instead of the C2-style "parameter 0 = red, parameter 1 = green, parameter 2 = blue", C3 color parameters are just a single value of "rgb" type. To get that you use the System expression "rgb" and pass it three numbers between 0-255 (not 0-100 like in C2).

    Solid red:
    Set effect "SetColor" parameter 0 to rgb(255, 0, 0)
    
    Solid green:
    Set effect "SetColor" parameter 0 to rgb(0, 255, 0)
    
    Solid blue:
    Set effect "SetColor" parameter 0 to rgb(0, 0, 255)
    
    Solid grey:
    Set effect "SetColor" parameter 0 to rgb(128, 128, 128)
    [/code:2of9s4bc]
    And so on. Hope this helps!
  • > I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?

    >

    SteamPoweredPix Hi, I was having the same exact problem - it really seemed as though effects that require color parameters were just broken in Construct 3, but they're not! Here's how pass color values to effects now.

    Instead of the C2-style "parameter 0 = red, parameter 1 = green, parameter 2 = blue", C3 color parameters are just a single value of "rgb" type. To get that you use the System expression "rgb" and pass it three numbers between 0-255 (not 0-100 like in C2).

    > Solid red:
    Set effect "SetColor" parameter 0 to rgb(255, 0, 0)
    
    Solid green:
    Set effect "SetColor" parameter 0 to rgb(0, 255, 0)
    
    Solid blue:
    Set effect "SetColor" parameter 0 to rgb(0, 0, 255)
    
    Solid grey:
    Set effect "SetColor" parameter 0 to rgb(128, 128, 128)
    [/code:26xeb3o7]
    And so on. Hope this helps!
    

    Works perfectly now, thanks

  • I was having similar issues and posted in the forums myself before finding this post.

    Thanks for sharing, this worked for me as well!

    Effect: "Set Color"

    Parameter: 0

    Value: rgb(RedSliderBar.Value, GreenSliderBar.Value, BlueSliderBar.Value)

    What's cool is that you can call values from other controls on your layout!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)