HEALTHBAR Self.position.x issue

PeeCeePeeCee Member Posts: 107
edited November -1 in Working with GS (Mac)
Hi All.

Im having an issue with the health bar. everything works and fine except the when i come to contrain the self.position.x .

I actually have my orientatioin as landscape left and I want the health bar to be top right corner of the screen however after I contrain the health bar actor self.position.x TO 10+(self.size.width /2) , then it moves it to top left corner of scene.

something small and i know it. any help would be appreciated.

cheers

Comments

  • old_kipperold_kipper Member Posts: 1,420
    Looking at your equation it reads as 10 (which gives it an offset of 10 from the lefthand side) + self size width over two. If you want it to sit top right you would add a greater value to the first number. If you want the bar to move leftward as health increased you would subtract the self size over two from the x position.
  • PeeCeePeeCee Member Posts: 107
    hiya kip. silly me.. not realising the simplest thing in the world. i guess thats my queue for a break. :). many thanks pal.
  • old_kipperold_kipper Member Posts: 1,420
    You are talking to a man who has been known to put the milk back in the cooker, so do not worry.

    Kipper
Sign In or Register to comment.