MOAITextBox text became white blocks after system update popup or app suspend on Android #627

Closed
JohnCopic opened this Issue Jan 31, 2013 · 2 comments

4 participants

@JohnCopic

A MOAITextBox on screen did not restore properly after an app suspend and resume on Android, or after a system pop up

Code as follows:

--main.lua
...
viewport = MOAIViewport.new ()
viewport:setSize ( 800, 600 )
viewport:setScale( 800, -600 )

layer = MOAILayer2D.new ()
layer:setViewport ( viewport )

MOAISim.pushRenderPass ( layer )
MOAISim.openWindow ( "GAME!", 800, 600 )

dofile ( "score.lua" )
...
drawScore()

-- main.lua end

-- score.lua

score = 0

font = MOAIFont.new ()
font:loadFromTTF ( "gfx/arialbd.ttf", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.?!", 12, 163 )

textbox = MOAITextBox.new ()
textbox:setFont ( font )
textbox:setRect ( 0, 0, 400, 80 )
textbox:setLoc ( -380, -280 )
textbox:setYFlip ( false )
textbox:setAlignment ( MOAITextBox.LEFT_JUSTIFY )
layer:insertProp ( textbox )

function drawScore ()
local scoreString = string.format("%08d", score);
textbox:setString ( scoreString )
textbox:revealAll ()
end

--score.lua end

@patrickmeehan patrickmeehan was assigned Feb 5, 2013
@ggsonic

encounter this problem too. with a earlier version source code fetched from origin/master on Dec7 2012,it works fine! But with a later version fetched on Feb7 2013 ,this problem happens. Hoping this bug can be fixed ASAP, and many Thanks for moai team's great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment