Healthbar with fixed vertical anchor?

I'm trying to create a health bar with a "fixed" vertical anchor but everytime the health increases the image moves up a bit. As soon as I change the vertical anchor from "fixed" to "stretch" it works fine. I just don't want the image to stretch, i want it to be fixed. Heres a link to the file. I'm using Windows version:

https://www.dropbox.com/s/m4hm1giguvmghvt/Healthbar.zip

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    There are many tutorial videos about this. Have you Googled it or searched the forums? Also check out the Spare Code thread. If you can't find it, let me know.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • toastyteetoastytee Member Posts: 53
    I meant to say vertical "wrap" not "anchor". I can't seem to find a video about it. I've tried constraining the vertical wrap and the vertical anchor but the images still moves when the health bar increases.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    Hmm... I must say I've never used anything but "stretch" for the vertical wrap because I always just use a solid color actor.

    The problem seems to be that the height isn't changing. If you turn off the y position constraint, you'll see that the height is constant even though game.Health is changing.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • toastyteetoastytee Member Posts: 53
    Hmm, that didn't work. I turned off the y position constraint and now the image constantly moves up even without increasing the health :(
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    My point is that fixed vertical wrap seems to limit the size of the actor. If you make a new actor with a rule that says When Touch is Pressed, change attribute self.size.height to self.size.height + 10 and set vertical wrap to fixed, you should see that if you click on the actor it doesn't appear to grow. At least that's what I found.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.