Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
White screen — Gideros Forum

White screen

Unknown Member
edited July 2015 in General questions
On my main scene I have a scores button. I have it showing the leaderboard with Google Play Services library, but once you click back you just get an all white screen. Same problem when dismissing an ad.

The appodeal ads show, but when it gets dismissed I get an all white screen.

Here is for the ads:
require "ads"
require "googleplay"
 
GameOver = gideros.class(Sprite)
 
INTERSTITIAL = 1
VIDEO = 2
BANNER = 4
BANNER_BOTTOM = 8
BANNER_TOP = 16
BANNER_CENTER = 32
ALL = 127
ANY = 127
 
function GameOver:init(t)
	appodeal = Ads.new("appodeal")
	appodeal:setKey("")
 
	GameOver:initializeGameSprites(self)
end
 
function GameOver:initializeGameSprites(self)
	fontLarge = TTFont.new("GROBOLD.ttf", 24)
 
	self:addChild(Bitmap.new(Texture.new("GameBG.png")))
 
	local imgGameOverBackdrop = Bitmap.new(Texture.new("GameOver.png"))
	imgGameOverBackdrop:setPosition(10, 5)
	self:addChild(imgGameOverBackdrop)
 
	local GameOver = TextField.new(fontLarge, "Your Score")
	centreAt(GameOver, 160, 150)
	GameOver:setTextColor(0xffffff)
	self:addChild(GameOver)
 
	local finalScore = TextField.new(fontLarge, _G.finalScore)
	centreAt(finalScore, 160,200)
	finalScore:setTextColor(0xffffff)
	self:addChild(finalScore)
 
	local applause = Sound.new("applause.wav")
 
	local btnSubmitScore = Button.new(Bitmap.new(Texture.new("btnSubmitScore.png")), Bitmap.new(Texture.new("btnSubmitScore.png")))
	btnSubmitScore:setPosition(50, 325)
	self:addChild(btnSubmitScore)
 
	btnSubmitScore:addEventListener("click", 
		function()	
			if _G.gLogin == false then
				--log into google play
				googleplay:login()
			else
				googleplay:reportScore("CgkIudWT9tcCEAIQAA", _G.finalScore)
			end
		end)
 
	googleplay:addEventListener(Event.LOGIN_ERROR, function()
		_G.gLogin = false
	end)
 
	googleplay:addEventListener(Event.LOGIN_COMPLETE, function()
		_G.gLogin = true
		googleplay:reportScore("", _G.finalScore)
	end)
 
	local btnMainMenu = Button.new(Bitmap.new(Texture.new("btnMainMenu.png")), Bitmap.new(Texture.new("btnMainMenu.png")))
	btnMainMenu:setPosition(50, 400)
	self:addChild(btnMainMenu)
 
	btnMainMenu:addEventListener("click", 
		function()	
			local transition = transitions[math.random(1, 4)]
			sceneManager:changeScene("MainMenu", 1, transition, easing.outBack, { eventFilter={Event.MOUSE_DOWN} } ) 
		end)
 
	--hook into the android back button	
	self:addEventListener(Event.KEY_DOWN, self.onKeyDown, self)
 
	self:addEventListener("enterBegin", self.onTransitionInBegin, self)
	self:addEventListener("enterEnd", self.onTransitionInEnd, self)
	self:addEventListener("exitBegin", self.onTransitionOutBegin, self)
	self:addEventListener("exitEnd", self.onTransitionOutEnd, self)
 
	if _G.soundEnabled == true then
		applause:play()
	end
end
 
function GameOver:onKeyDown(event)
	if (event.keyCode == KeyCode.BACK) then
		local transition = transitions[math.random(9, 12)]
		sceneManager:changeScene("MainMenu", 1, transition, easing.outBounce, { userData = "outBounce" } )
	end
end
 
function centreAt(sprite,x,y)
   local w=sprite:getWidth()
   local h=sprite:getHeight()
 
   sprite:setPosition(math.floor(x-w/2),math.floor(y+h/2))
end
 
function GameOver:onTransitionInBegin()
	print("Credits - enter begin")
end
 
function GameOver:onTransitionInEnd()
	appodeal:showAd(INTERSTITIAL)
end
 
function GameOver:onTransitionOutBegin()
	print("Credits - exit begin")
end
 
function GameOver:onTransitionOutEnd()
 
end
for leaderboards:
btnScores:addEventListener("click", 
		function()	
			if _G.gLogin == false then
				--log into google play
				googleplay:login()
			else
				googleplay:loadScores("")
			end
		end)
 
	googleplay:addEventListener(Event.LOGIN_ERROR, function()
		_G.gLogin = false
	end)
 
	googleplay:addEventListener(Event.LOGIN_COMPLETE, function()
		_G.gLogin = true
		googleplay:showLeaderboard("")
	end)

Comments

  • hgy29hgy29 Maintainer
    Problem spotted, fixed in sources and tested ok on a few devices (it doesn't happen on all devices). The fix will be included in the next release. :)
Sign In or Register to comment.