3
아래는 내가 쓰고있는 간단한 게임 코드의 일부입니다. 사용자가 메뉴 화면에서 보낸 시간을 포함하는 이메일을 보내려고합니다. 옵션 기능을 호출 할 위치가 확실하지 않습니다.이 코드에서 코로나로 이메일을 보내는 기능을 어떻게 호출합니까?
--Send a email to my own address
local options =
{
to = "[email protected]",
subject = "Time spent at the menu screen",
body = "This is the time I spent to look at the menu"..(os.time() - startTime),
}
native.showPopup("mail", options)
--Function that initializes all game logic
function Main()
splash:removeSelf()
splash = nil
playGame = display.newImage("Play Button.png")
tutorial = display.newImage("Tutorial Button.png")
credits = display.newImage("Credits Button.png")
playGame.x = display.contentWidth/2
playGame.y = display.contentWidth - 187
tutorial.x = display.contentWidth/2
tutorial.y = display.contentWidth - 130
credits.x = display.contentWidth/2
credits.y = display.contentWidth - 73
startButtonListeners('add')
end
--Adds listeners to the button in menu screen
function startButtonListeners(action)
if (action == 'add') then
playGame:addEventListener ('tap', showGameView)
credits: addEventListener ('tap', showCredits)
tutorial: addEventListener ("tap", showTutorial)
else
playGame:removeEventListener ('tap', showGameView)
print("Time spent at menu screen: ", (os.time() - startTime))
credits: removeEventListener ('tap', showCredits)
tutorial: removeEventListener ('tap', showTutorial)
end
end
감사 코딩 유지,이 중량입니다 내가 찾고 있어요. Btw, 코드가 컴퓨터에서 작동하는지 테스트하는 방법이 있습니까? 코드를 실행했지만 아무 일도 일어나지 않았으며 이메일을 찾을 수 없습니다. – user3305142
코로나 기본 메일 팝업은 코로나 시뮬레이터에서 작동하지 않습니다. Xcode 시뮬레이터 용 또는 테스트 용 장치 중 하나를 빌드해야합니다. –