I want to tween a Rectangle’s Width to 0, while respecting its 0.5 Origin value.
My expectation is that it should shrink horizontally towards its center, without the need to manually change the x value.
This sandbox demonstrates what I want. Look at the White bar, compared to the others. I achieved the desired effect with the Red and Cyan bars by changing the x value as a function of the current width during the tween’s progress. (One by tweening the x as well if the x is static, one by doing it in the onUpdate if the x is dynamic.
This way any stroke I have on the shape does not get distorted. displayWidth and scaleX both shrink the stroke, which is not the desired look I want for a “Time Remaining” bar.