playMaker

Author Topic: Light intensity slider  (Read 2591 times)

richardh

  • Junior Playmaker
  • **
  • Posts: 97
Light intensity slider
« on: September 15, 2015, 12:07:18 PM »
Hi again
I've not been using Playmaker for a bit and I'm kind of rusty now!
Could someone give me a lowdown on how to adjust a scene light's intensity using a slider?
I want a light to be very low intensity at the start of the scene and with the use of a slider I'd like the intensity to increase.

thanks for the help.

Richard

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Light intensity slider
« Reply #1 on: September 15, 2015, 07:33:07 PM »
Just create a ugui slider and use the Playmaker ugui actions https://hutonggames.fogbugz.com/default.asp?W1192

And have the sliders float value drive the "set light intensity" action that is available on Ecosytem
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

richardh

  • Junior Playmaker
  • **
  • Posts: 97
Re: Light intensity slider
« Reply #2 on: September 19, 2015, 04:04:29 PM »
Thanks
Think I've sorted it now. I have a slider that will adjust the light intensity as the slider is adjusted and also if the up or down arrow keys are pressed.

The next thing I'm struggling with is displaying the light intensity on the screen. The variable is a float and so I have tried to convert the float to a string and then used a 'set gui text' state to display on the screen. But no good at the moment. I remember having a lot of trouble getting to grip with displaying scores and the like on the screen but i couldn't remember what I'm supposed to use.. e.g GameObject/UI/Text doesn't work, nor GameObject/UI/Canvas. Also tried Component/UI/Text but that doesn't seem to work either.

Can someone help?

So I have a light intensity set as a float. I'd like to have this float variable displayed on the game screen so when the slider is used or the UP/DOWN button is pressed the light intensity float also changes on screen.

thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Light intensity slider
« Reply #3 on: September 20, 2015, 01:25:19 PM »
Hi,
gameOject/UI/Text should be good

are you using every frame?
did you add the ugui proxy?

here is a picture how it should work :