change any SetSpritePosition() (for sprites that are blocking your text) to offscreen like SetSpritePosition(#,200,200) and then add PasteSpritePosition() command to main(e) with the old values (i.e. #,0,0)
then put the text in the main(e) using the Text commands
this might work (untested), just make sure any images are valid (i.e. the names match the script)
-- Loading page script
g_strStyleFolder = ""
g_strBestResolution = ""
g_imgBackdrop = 0
g_sprBackdrop = 0
g_imgHeading = 0
g_sprHeading = 0
g_imgProgressB = 0
g_sprProgressB = 0
g_imgProgressF = 0
g_sprProgressF = 0
g_iLoadingCountdown = 0
local hint = {}
local random_image = {}
hint[1] = "This is hint 1"
hint[2] = "This is hint 2"
hint[3] = "This is hint 3"
hint[4] = "This is hint 4"
random_image[1] = "loading1.png"
random_image[2] = "loading2.png"
random_image[3] = "loading3.png"
local rhint = math.random(1,#hint)
local rimage = math.random(1,#random_image)
function loading_init()
-- determine style folder we are in
file = io.open("titlesbank\\style.txt", "r")
if file ~= nil then
io.input(file)
g_strStyleFolder = io.read()
io.close(file)
end
-- choose ideal resolution
resolutions = require "titlesbank\\resolutions"
g_strBestResolution = resolutions.findclosest()
-- backdrop
g_imgBackdrop = LoadImage("titlesbank\\" .. g_strStyleFolder .. "\\" .. g_strBestResolution .. random_image[rimage])
g_sprBackdrop = CreateSprite ( g_imgBackdrop )
SetSpritePosition ( g_sprBackdrop, 200, 200 ) --move the sprite off screen
SetSpriteSize ( g_sprBackdrop, 100, 100 )
-- loading header and progress
g_imgHeading = LoadImage("titlesbank\\" .. g_strStyleFolder .. "\\loading-text.png")
g_sprHeading = CreateSprite ( g_imgHeading )
SetSpritePosition ( g_sprHeading, 50, 80 )
SetSpriteOffset ( g_sprHeading, GetImageWidth(g_imgHeading)/2, 0 )
g_imgProgressB = LoadImage("titlesbank\\" .. g_strStyleFolder .. "\\loading-bar-empty.png")
g_sprProgressB = CreateSprite ( g_imgProgressB )
g_imgProgressF = LoadImage("titlesbank\\" .. g_strStyleFolder .. "\\loading-bar-full.png")
g_sprProgressF = CreateSprite ( g_imgProgressF )
SetSpritePosition ( g_sprProgressB, 50, 90 )
SetSpriteOffset ( g_sprProgressB, GetImageWidth(g_imgProgressB)/2, 0 )
SetSpritePosition ( g_sprProgressF, 50, 90 )
SetSpriteOffset ( g_sprProgressF, GetImageWidth(g_imgProgressB)/2, 0 )
-- loading page logic
g_iLoadingCountdown = 10
end
function loading_main()
PasteSpritePosition(g_sprBackdrop, 0, 0 ) --moves the sprite to the back so text can appear above it
TextCenterOnX(50,50,3,hint[rhint]) --shows your hint in the center of the screen
-- loading page loop
g_iLoadingCountdown = g_iLoadingCountdown - 1
if g_iLoadingCountdown <= 0 then
-- Loading Resource specifies sprites used outside of LUA system - all sprites are force drawn in reverse order
SetLoadingResource(0,4) -- number of sprites up to 63
SetLoadingResource(1,g_sprProgressF) -- sprite size width controlled by progress percentage (always [1])
SetLoadingResource(2,g_sprProgressB) -- used as a guide to the total width of progress at 100% (always [2])
SetLoadingResource(3,g_sprHeading) -- the LOADING text
SetLoadingResource(4,g_sprBackdrop) -- the overwriting backdrop to hide 3D elements
StartGame()
end
end
function loading_free()
-- resources specified above deleted in engine
-- as sprites need to survive deletion of this LUA script
end