The Daily Click ::. Forums ::. Klik Coding Help ::. "Graphic Text" In TGF
 

Post Reply  Post Oekaki 
 

Posted By Message

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
23rd May, 2004 at 08:58:36 -

I am using TGF and am trying to make a little application for my mates.

What it does is this..

I have made some little pixel letters:
Image

Now when a person types in the box and clicks "create", I want the letters to come out as:

Image

So if a person types "TEXT" and clicks create, the above will show.

However I have tried and tried and cannot create a good enough code for this to work.

I figured I may need extensions, or figured that I am not experienced enough to do this.

Can anybody help me please? :S

 
This is a signature. Have this one on me.

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
23rd May, 2004 at 09:04:42 -

The only way I can think of doing it in TGF is to actually make your own font consisting of those letters.

 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
23rd May, 2004 at 09:06:04 -

Well I not exactly an expert with fonts - and can you have fonts with 2 different colours on? :S

Also one thing I tried was..
I made 10 counters with the letters in as animations (1=A and 2=B .etc).

Then set global value as one.
+Player presses A
+Global Value = 1
-Set counter to 1
-Set global value to 2

+Player presses A
+Global Value = 2
-Set counter2 to 1
-Set global value to 3

So the global value represented which counter the user was changing.. However when I press A the global value goes straight to 3 (because you keep hold of A) and also it will take ages to do all that code for each letter

Also, is it possible to do it in MMF? If so please tell me - although I would rather do it in TGF (as I dont have MMF yet)

Image Edited by the Author.

 
This is a signature. Have this one on me.

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
23rd May, 2004 at 09:17:51 -

I think the Text Blitter extension...for MMF...can do stuff like this.

 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
23rd May, 2004 at 09:25:42 -

to do this in MMF, i'd do a loop (activating when the user clicks create) which goes through each letter that has been typed, then have events like:

+On loop "create"
+letter = "a"
-create "letter a" object at (setx,sety)
-add width_of_spacing to setx

you can use the Mid() expression in MMF to get an indivdual letter of a string, so you'd have

+ set alterable string of "letter" to Mid$( Edittext$( "Edit" ), LoopIndex("create"), 1)

i don't think this can be done in TGF.

 
www.thenatflap.co.uk

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
23rd May, 2004 at 09:50:35 -

Well doesnt seem that I'll be able to get MMF for about a year or so lmao

Thanks anyway guys

 
This is a signature. Have this one on me.

Kramy



Registered
  08/06/2002
Points
  1888
23rd May, 2004 at 12:45:07 -

Use Text-Blitter(For MMF)

You insert the letters like yours into it's grid. Specify a gridsize(8x12, etc) then it cuts em up and displays them when you pass it a string. Simple. (or atleast simpler )

 
Kramy

Cybermaze



Registered
  03/04/2003
Points
  853
23rd May, 2004 at 17:01:54 -

Well ... its not a very easy task ... but Im sure it can be done even in TGF ... my best solution right now is:

1. Every letter, number, etc is an independant active object.
2. For every "letter" you can enter make a text object and instruct people to enter one "letter" in each of the text objects.
3. When create button is pressed test every text object for what is typed (one event for each legal "letter") (this have to be done for every text object so it is tedious) and create the appropriate "letter" object.

However if you could do more with the text object there must be a better solution ... investigating ...

 
If you knew, I would have to kill you...

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
24th May, 2004 at 02:39:18 -

Text Blitter would be the easiest solution but since you don't have MMF I would suggest making all of those letters differant objects and then parsing a string with a string pasing extension. So the code would be something like this:

Editbox.text has changed - Parsestring in edit box

While parsing string and found letter "A" then create letter A at (marker.x\y)


You will need to have an object or counters, that moves forward to the next letter position everytime a letter is pressed. As for the string parsing you will need to set each letter to a token.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
   

Post Reply



 



Advertisement

Worth A Click