Move actor with with Slider

7thSkull7thSkull Member Posts: 10
edited November -1 in Working with GS (Mac)
hello all

i work on a game where the player control his actor via slider. now the problem is, the slider is smaller then the hole scene. in fact the scene is 640 and the slider have only a maximum value of 162.
if i constrain the self position of the actor to slider (position-68)*3.9506 "cause the slider minimum position is 69" it wont work.

now is there any way to do that with percentage, so the minimum slider position 68 is 0% and the maximum position 240 is 100%.

so the slider write in a real attribute the percentage. from 0% to 100%

the actor change the position with the amout of the percentage.

any help?

best regards

michael

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey 7thSkull

    I just posted this demo the other day:

    http://gamesalad.com/game/play/30207

    You can use it for moving your actor.

    The ratio that I have in there will work for a slider of any length.

    Just change your leftLimit to 68 and your rightLimit to 240

    It currently sets an attribute called musicVolume, just change that to ActorX, or whatever

    Hope this Helps!
    Joe
Sign In or Register to comment.