Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Getting the current Ambient color of a scene / actor.  (Read 3292 times)

0 Members and 1 Guest are viewing this topic.

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Getting the current Ambient color of a scene / actor.
« on: June 25, 2013, 08:13:11 AM »

Hello How exactly would I get the ambient color of a scene or an actor ? I saw the code for GetRValue, etc but it doesnt seem to work for me. Is there a specific way to do this?

I tried Game.Msg(actor.GetRValue());   Did not work

Also tried:

Code: WME Script
  1. var value = actor.AmbientLightColor;
  2. Game.Msg(value.GetRValue());
  3.  

 That did not work either. Any thoughts?

Thanks
« Last Edit: June 25, 2013, 09:11:25 AM by piagent »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Getting the current Ambient color of a scene / actor.
« Reply #1 on: June 25, 2013, 10:26:29 AM »

actor.AmbientLightColor and Scene.AmbientLightColor ARE the colors. GetRValue() gets the red portion of the RGB color.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Getting the current Ambient color of a scene / actor.
« Reply #2 on: June 25, 2013, 10:30:41 AM »

I need to know each of the current RGB values for an actor after changing the value from doing actor.AmbientLightColor = MakeRGBA(value_R,value_G, value_B); 
 Any help would be appreciated  ::beer
« Last Edit: June 25, 2013, 10:58:19 AM by piagent »
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Getting the current Ambient color of a scene / actor.
« Reply #3 on: June 25, 2013, 11:16:57 AM »

Not tested but:

Code: WME Script
  1. var Red = GetRValue(actor.AmbientLightColor);
  2. var Green = GetGValue (actor.AmbientLightColor);
  3. var Blue = GetBValue (actor.AmbientLightColor);
  4. var Alpha= GetAValue(actor.AmbientLightColor);

Should work.
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Getting the current Ambient color of a scene / actor.
« Reply #4 on: June 25, 2013, 08:56:34 PM »

Thanks Azrael, seems to work that way  ;D
Logged
 

Page created in 0.063 seconds with 25 queries.