Thanks fellas, this works great for what I need for. Some great advice there too. Here's how I've got it setup using the advice of all 3 of you.
function func_createtext( Text$, Xpos, Ypos, Size, ColorRed, ColorGreen, ColorBlue, ColorAlpha )
Text = CreateText( Text$ )
settextcolor ( Text, ColorRed, ColorGreen, Colorblue, ColorAlpha )
settextsize ( Text, Size )
settextposition ( Text, Xpos, Ypos )
endfunction Text
Example:
txt_fps$ = "FPS: "
txt_fps = func_createtext( txt_fps$, 0, 0, 13, 255, 0, 0, 255 )
Using "txt_fps = func_createtext" let's me use something like this for modifying the string;
var_fps = ScreenFPS( )
SetTextString( txt_fps, "FPS: " + str(var_fps) )
So thanks guys for the input, really helps makes it more manageable.
On to another question, related to CreateText. I've noticed that when you use CreateText to create a string that uses a variable
such as below, it won't automatically use the updated value in the variable with each sync(). It keeps the same value as the variable held the first time it was past the variable.
CreateText( 1, "Somethings Value: " + str(var_something) )
So I set 'var_something' to '20' it will always show 20 even if I should 'var_something' to '100'. I take it text objects are not as dynamic like I'm used to in DBP? I know you can use SetTextString to modify the string but having to pass that every sync() seem's a little strange to me.
It's also impossible to update with the following method I've used. Note: Uses the func_createtext from above.
t = 1
for t = 1 to 10
txt_prices_buy$ = "" + str(arr_prices[var_planet,t])
txt_prices_buy = func_createtext( txt_prices_buy$, 500, 85 + (t*15), 13, 255, 255, 255, 255, 0)
txt_prices_cargo$ = "" + str(arr_owned_cargo[t])
txt_prices_cargo = func_createtext( txt_prices_cargo$, 640, 85 + (t*15), 13, 255, 255, 255, 255, 0)
next t
Any idea's on how I can work this to make it updateable or at least have text objects check the variable each time a sync() occurs.
Thanks for the advice thus far, this is all new to me and I'm stuck in DBP mode =)