I have been testing many things to make an image appear like a HUD display or if you will like a sun rising on the horizon.
I am just not getting this to work.
Hope someone can help me [import]uid: 61610 topic_id: 12139 reply_id: 312139[/import]
I have been testing many things to make an image appear like a HUD display or if you will like a sun rising on the horizon.
I am just not getting this to work.
Hope someone can help me [import]uid: 61610 topic_id: 12139 reply_id: 312139[/import]
Just to answer my own question. If someone has a better way to do this, I would love to see it
[lua]H = display.contentHeight
W = display.contentWidth
local bottomRect = display.newRect(0,300, W, H - 300)
local bottomgroup = display.newGroup()
bottomRect:setFillColor(140, 140, 140)
bottomgroup:insert(bottomRect)
local sun = display.newImage(“sun.jpg”)
sun.y = H + (sun.height/2)
sun.x = W / 2
bottomgroup:insert(sun)
sun:toBack()
local sunIsVisible = false
local function showsun()
if (sunIsVisible == false) then
transition.to(sun, {time=1000, y=1000})
print “sun is now visible”
elseif (sunIsVisible == true) then
transition.to(sun, {time=1000, y=300-(sun.height/2)})
print “sun is not visible”
end
sunIsVisible = not sunIsVisible
end
Runtime:addEventListener(“tap”, showsun)[/lua] [import]uid: 61610 topic_id: 12139 reply_id: 44169[/import]