I am trying to create a bar whose width I can modify dynamically. The bar is constructed of three pieces: a left piece, a middle piece and a right piece. My plan is to adjust the width of the bar by setting the width of the middle piece such that the total width of the three pieces is the desired width of the bar. In other words:
barWidth = left.width + mid.width + right.width
If left.width and right.width are both 10 and I want a barWidth of 100, then I will set the mid.width to be 80.
I have managed to create an Item that does this using Image components but I would ideally like to use SingleSpriteFromFile components so that I can have all my graphics on a sprite sheet. The problem is that I can’t seem to modify the width of the SingleSpriteFromFile components. Is there any way around this?