Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Global Text Commands

Author
Message
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 30th Dec 2011 11:06
I have a question I'm wondering if you friendly AppGameKit user's can help me with.

Is there a global text command to set a constant colour and size for all Text Objects? Having to do the following for all my text objects is rather time consuming not to mention increases my line count (and there for takes up more view spacing within the IDE).

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 30th Dec 2011 15:23

As you wish.

My signature is NOT a moderator plaything! Stop changing it!
westalke
12
Years of Service
User Offline
Joined: 8th Dec 2011
Location:
Posted: 30th Dec 2011 15:25
There is no inbuilt function to handle default text color etc.

Just write a function of your own to handle this sort of thing ,,, something like

PlaceText("my text",200,100)

And do the color and placement in one call.

Also makes it easy to do shadow backdrops and such at the same time

Westa
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 4th Jan 2012 01:02
You can use up to 9 paramaters in the function call, so...

Text$
Xpos
Ypos
Size
ColorRed
ColorGreen
ColorBlue
ColorAlpha
ShadowFlag

would make a good function set. That's pretty near to what I used in Particle Sandbox.
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 6th Jan 2012 14:05 Edited at: 6th Jan 2012 17:34
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.



Example:



Using "txt_fps = func_createtext" let's me use something like this for modifying the string;


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.



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.



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 =)

Login to post a reply

Server time is: 2024-11-22 20:29:59
Your offset time is: 2024-11-22 20:29:59