Just getting started with Corona and having trouble doing something that seems like it should be really easy.
I want to have a rectangle with the upper-left corner at 0,0 and then be able to specify a width from 0 to the display.contentWidth (like making my own progress bar). I have tried this:
local progress = display.newRect(0,0,display.contentWidth,20);
progress:setFillColor( 255, 0, 0);
progress.width = display.contentWidth / 2;
But since objects are centered on the screen, the resulting rectangle moves from the 0,0 origin and is now horizontally centered.
I want to change the width of the rectangle WITHOUT moving the X origin. I’d really like to avoid having to write my own method (and using object inheritance, etc) just to override this behavior.
Seems like there should be some setting of xOrigin or xReference that would make the rectangle be left-aligned always instead of always centered. But I haven’t found any way to do this.
This default of having everything centered is really driving me crazy for UI design.
Thanks for any help you can give. [import]uid: 12529 topic_id: 5839 reply_id: 305839[/import]
