Dear gurus,
I am thinking to create a street fighter like HP bar. Whenever the play get hit, the HP bar will reduce.
So, player 1, Left side will have have a HP bar, left top of the screen.
But what’s stopping me is… the ‘reduce hp’ always based on center reference point, so the shrink of the image doesn’t really look nice
local function testHPReduce()
print('In Function testHPReduce()')
local g = graphics.newGradient(
{ 0, 255, 0 },
{ 200, 0, 0 },
"right" )
-- sets gradient 'g' on rect
local rect = display.newRect( 0, 0, 480, 100 )
rect:setFillColor( g )
transition.to(rect, {time = 1000, width = 200})
end
can someone show me how to fix this?
Thanks [import]uid: 10373 topic_id: 30593 reply_id: 330593[/import]