Jump to content

color property in editor and alpha


Rick
 Share

Recommended Posts

Making a model script where I have a setting in the properties dialog defined as:

 

group:AddProperty("bgcolor", PROPERTY_COLOR, "1", "BG Color")

 

Inside object:SetKey() I have it defined as:

 

elseif key == "bgcolor" then
  self.bgColor = StringToColor(value)
  Notify(self.bgColor.w)

 

 

The alpha is always 0 for me. I'm looking at the environment_atmosphere script to see how it does it and I can't see what I'm doing wrong. w is always 1 for that script. In the properties dialog when you define as PROPERTY_COLOR it only gives you 3 boxes for r,g,b and no place for the alpha so not sure how that's working.

 

I've been coding all day for I'm sure my eyes and brain just aren't connecting something ;)

Link to comment
Share on other sites

I didn't have anything, but after copying the atmosphere GetKey() it worked. So why is that needed? The other values were fine without having anything in GetKey(). Is this a cork of the PROPERTY_COLOR?

 

 

and something is wrong because PROPERTY_COLOR gives four boxes plus a color button to open up the colorpicker dialog...

 

Now it's showing 4. Aw bugger I swear it was only showing 3. I'll have to see if there was some scenario that caused that.

 

Thanks for the help.

 

[edit]

Sometimes it's 3 and sometimes it's 4 it seems

 

Color.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...