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 / Text to Sprite

Author
Message
jomajuga
12
Years of Service
User Offline
Joined: 7th Sep 2011
Location:
Posted: 4th Oct 2011 03:12
Does anyone know if it is possible to turn a text string into a sprite using AppGameKit?
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 4th Oct 2011 13:40
I am not sure why you need to text objects are treated in much the same way.
Bursar
15
Years of Service
User Offline
Joined: 17th Sep 2008
Location:
Posted: 4th Oct 2011 15:04
Quote: "I am not sure why you need to text objects are treated in much the same way."

Can you apply physics and rotations to text objects? (aside from using them to put simple text on screen, I haven't played with them much).
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Oct 2011 15:31
Quote: "Can you apply physics and rotations to text objects? (aside from using them to put simple text on screen, I haven't played with them much)."

No I don't think you can add physics but I think you can rotate them... yes (just checked), you can even rotate individual characters in a string

But for physics you would have to create an image in an editor and turn physics on.

Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 5th Oct 2011 23:09
baxslash, how do you suggest rotating the whole text? I only found code to rotate individual characters in the textobject.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
jomajuga
12
Years of Service
User Offline
Joined: 7th Sep 2011
Location:
Posted: 6th Oct 2011 04:30
What I'm trying is to display a dynamically generated text right in front of a sprite to make it seem as the text is actually printed on the object.

Literally, I want to have a mathematical operation printed on a bomb. The player would have to solve the operation before the bomb reaches the ground... But I'm still in trouble regarding the text right in front of the bomb... Any ideas?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Oct 2011 10:42
@jomajuga, just use the "setSpriteDepth" and "setTextDepth" commands giving the text a smaller value. This will put the text in front of the sprites. At default text is set at a depth of 9 which should be in front of other sprites unless you have edited the sprite depth.

@Impetus73, You're right, only individual characters can be rotated. There's an enhancement request for the board. If I get time later I'll add it. In the mean time you'd have to place characters individually too which is a real pain! Not impossible though. Might make a handy code snippet.

Rotating individual characters does make it possible for text to follow a curve / angle or just look more 'jumbled' though which is cool...

Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 6th Oct 2011 15:36
Sinus scrolls!

I guess with clever rotation and displacements of each individual characters, and plotting them around a circle like planets in a solar system, one can get a rotated text, but it would eat alot of processor cycles.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
jomajuga
12
Years of Service
User Offline
Joined: 7th Sep 2011
Location:
Posted: 7th Oct 2011 03:47
Thank you, I will prove with the properties of the object text.
JRNTexas
12
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 7th Oct 2011 08:30
If you need for text to use physics, have the text follow a sprite.

Login to post a reply

Server time is: 2024-04-16 23:43:05
Your offset time is: 2024-04-16 23:43:05