I have a score based app and I want to change the color of the score . It is currently white and I want it to be black . If you need it Score.lua :
local M = {} M.score = 0 function M.init( options ) local customOptions = options or {} local opt = {} opt.fontSize = 50 opt.font = "00\_starmap - Shortcut" opt.x = 120 opt.y = 50 opt.maxDigits = 7 opt.leadingZeros = false M.filename = "restart.lua" local prefix = "" if ( opt.leadingZeros ) then prefix = "0" end M.format = "%" .. prefix .. opt.maxDigits .. "d" M.scoreText = display.newText( string.format(M.format, 0), opt.x, opt.y, opt.font, opt.fontSize ) return M.scoreText end function M.set( value ) M.score = value M.scoreText.text = string.format( M.format, M.score ) end function M.get() return M.score end function M.add( amount ) M.score = M.score + amount M.scoreText.text = string.format( M.format, M.score ) end function M.save() local path = system.pathForFile( M.filename, system.DocumentsDirectory ) local file = io.open(path, "w") if ( file ) then local contents = tostring( M.score ) file:write( contents ) io.close( file ) return true else print( "Error: could not read ", M.filename, "." ) return false end end function M.load() local path = system.pathForFile( M.filename, system.DocumentsDirectory ) local contents = "" local file = io.open( path, "r" ) if ( file ) then -- Read all contents of file into a string local contents = file:read( "\*a" ) local score = tonumber(contents); io.close( file ) return score else print( "Error: could not read scores from ", M.filename, "." ) end return nil end return M
Thank you .