Hey folks,
I’ve come across some weird behaviour, and was wondering if anyone else has experienced anything similar, and can maybe suggest a workaround?
I am trying to implement a simple custom progress bar, consisting of a single rectangle, which, using transition.to(), expands its width to the required size to indicate the progress so far.
Simple. You would think.
Here is the simplified code, for the purpose of demonstration.
local progressBarWidth = 300
local progressBar = display.newRect( 0, 0, 0, 15 )
progressBar:setReferencePoint( display.TopLeftReferencePoint )
progressBar.x, progressBar.y = 40, 30
progressBar:setFillColor( 255,0,0 )
transition.to( progressBar, { delay = 1000, time = 500, width = progressBarWidth, transition = easing.inQuad } )
The progress bar is set with a reference point of TopLeft, but as the width increases during the transition, the bar expands both left and right, as if it has a Center reference point.
huh?!
Any ideas? :-s [import]uid: 60457 topic_id: 34848 reply_id: 334848[/import]
[import]uid: 60457 topic_id: 34848 reply_id: 140067[/import]