简体   繁体   中英

Event only working the first time

I have this image:

local core = display.newImage("images/core.png", (display.contentWidth/2), display.contentHeight/5)

And when something happened i do this:

spinCore()

Calling this function:

local function spinCore()
    transition.to(core,{time=500,rotation=360})
end

This is working, but only the first time i do this, by the next ones it isn´t working. I hope you can help me. Thank you!

Just do like:

local function spinCore()
    transition.to(core,{time=500,rotation=core.rotation+360})
end

Keep coding.................. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM