Math Heavy
I'm making a custom character menu but am having trouble getting the width of the hair sprite to function correctly. I have a head sprite and I have a Hair Sprite and both are animations that contain all the individual pieces. That way all I have to do is +/- a frame to cycle all my parts. I have a point where the top of the head meets the hair who's point is where the top of the head should be. So I can not statically set a with for each hair as it would change width every frame of the head and I have now 20 heads and 40 - 60 hair options.
In the image below I drew out what I am trying to do algebraically which is aliening a image point where the temple on the left side of the head should fall. Thus dynamically seating the width of the hair sprite regardless of which head or hair image.
I think I am doing the math right however I still am having issues as the hair is too small but if I know my High School algebra (from a longer time ago than I care to admit) This should give me what I am looking for assuming that the distance form the image point to the center of the sprite is the same distance for the Hair and the Head respectively.
Thank you for your time in helping me solve this.
-edit- Ahhh I made a typo when entering the string, now that I asked for the help
distance(Head.BBoxLeft, Head.ImagePointY(5), Head.ImagePointX(5), Head.ImagePointY(1))+distance(Head.BBoxLeft, Head.ImagePointY(0), Head.ImagePointX(0), Head.ImagePointY(0))-distance(Hair.BBoxLeft, Hair.ImagePointY(1), Hair.ImagePointX(1), Hair.ImagePointY(1))
that sets it right. Hope that this will help someone who will need to do the same thing.