local openfeint = require("openfeint")
openfeint.init( "XXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXX", "MY GAME NAME", "1234567" )
When I launch a new build of my game (first time game is ever played) it displays an OpenFeint screen asking if I want to enable OpenFeint for my game.
I have played other games (possibly not created with Corona) where this does not occur and instead there is a button to launch OpenFeint.
Anyway my game includes a button to launch the openFeint dashboard but I would like to know if I can prevent the openFeint screen displaying when game first launched? Perhaps it is not sensible to remove it but it is quite annoying.
Thanks
Paul [import]uid: 7863 topic_id: 5337 reply_id: 305337[/import]
I guess try put that code in a button? Does that work?
It should cause I used it with a timer before! [import]uid: 10657 topic_id: 5337 reply_id: 17728[/import]
Doh, yeah good point. I thought I had read that the require and initi needed to be called as early as possible but not sure why.
I guess I can set a variable to stop it calling the code every time the user clicks on the openfeint button [import]uid: 7863 topic_id: 5337 reply_id: 17731[/import]
Works fine when setting a global variable to remember if openFeint initialised yet
So I have in main.lua
local openfeint = require("openfeint")
gOpenFeintInitialised = false
And in screen1.lua (Main Menu)
local function clickOpenFeintButton ( event )
local self = event.target
if event.phase == "ended" then
local bounds = self.stageBounds
local x,y = event.x,event.y
local isWithinBounds = bounds.xMin \<= x and bounds.xMax \>= x and bounds.yMin \<= y and bounds.yMax \>= y
if isWithinBounds then
if gOpenFeintInitialised == false then
openfeint.init( "XXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXX", "MY GAME NAME", "1234567" )
gOpenFeintInitialised = true
end
openfeint.launchDashboard()
end
end
end