So I created two scripts, one to set up the HUD 'background' which shouldn't need to be updated much hence inserting the 'background image' here.
Then the second which is the regularly updated actual scores.
BUT although I set the image to depth of the sprite to 100 the text still displays behind it? (I know it's commented out below, but that was the last time I 'trialed' something else...)
Is there a way to bring it in front of the sprites?
And the text disappears when you go in zoom mode - the sprites stick around. Can I make the text 'sticky' too?
AND; as I type, I am wondering if I should combine the two scripts into one anyway..
SETUP SCRIPT:
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
g_score_heads = 0
g_score_kills = 0
g_score_cash = 0
g_score_xp = 0
function _01stored_init(e)
hdkillImageBack = LoadImage ( "scriptbank\\soundesign\\images\\hdkill.png" )
hdkillSprite = CreateSprite (hdkillImageBack)
--setSpriteDepth (hdkillSprite, 100)
xpcashImageBack = LoadImage ( "scriptbank\\soundesign\\images\\xpcash.png" )
xpcashSprite = CreateSprite (xpcashImageBack)
--setSpriteDepth (xpcashSprite, 100)
end
function _01stored_main(e)
SetSpriteSize ( hdkillSprite , -1 , -1 )
SetSpritePosition ( hdkillSprite , 1 , 0 )
SetSpriteSize ( xpcashSprite , -1 , -1 )
SetSpritePosition ( xpcashSprite , 83 , 0 )
end
SCORE TRACKING SCRIPT:
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
g_score_heads = 0
g_score_kills = 0
g_score_cash = 0
g_score_xp = 0
function _02scores_init(e)
end
function _02scores_main(e)
TextCenterOnX (9,3,4,g_score_heads)
TextCenterOnX (9,9,4,g_score_kills)
TextCenterOnX (91,3,4,g_score_xp)
TextCenterOnX (91,9,4,g_score_cash)
end
OOOOOPS!!!!
just noticed I set up the globals twice!!! still seems to work for now in my test game, but I'm gonna smack it the hell out now...