Hi,
I have an object declared
[lua]local image = display.newImage(“somepic.png”)[/lua]
and I also have some event handlers set on this object, so
[lua]local function=onTOuchEventHandler( event )
end
image:addEventHandler(“touch”,onTouchEventHandler)[/lua]
Now somewhere in the code, I need to change the image from somepic.png to thispic.png
I am missing the setImage equivalent, must be coz it’s past 1:00 in the morning
Must not try to program after 11:00 pm and that too without Coffee or other such JOLT drinks.
It kind of worked out by itself. I guess the issue was
function changePic(event)
obj:removeSelf()
obj = display.newImage("thispic.png")
obj:addEventListener("touch",onTouch)
end
function onTouch(event)
end
obj:addEventListener("touch",onTouch)
The function was so placed that it was creating an error, so I created a blank function above the remove code and that worked.
Hi Tim,
I thought of it, but could not see a way to get the object clicked on.
I know that to check collision I can use the event.object1 and event.object2, are they the same that I can use for touches? (I guess I need to test it via code than asking)
is there a function equivalent to CGRectContainsPoint or the CGRectIntersection in Corona?
cheers,
Jayant C Varma [import]uid: 3826 topic_id: 3391 reply_id: 10230[/import]