About Text And The Write Command...


Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Is there any way to make text appear below sprites? I mean, to have text just in the background, so everything that happens, happens above the written text and not below?


If not, is there any way to make fonts (parts of) transparent?
 

madog

Still Fresh
Joined
May 30, 2005
Messages
10
Age
45
Location
Torino - Italy
Website
www.airborn.bl.am
You should use text_z
It's like the z value for processes...
unfortunately this will affect all your texts! There's no way to write text with different z in fenix.

To be honest that is how div worked, but I'm pretty sure fenix is the same...
 

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Thanks!

I searched the Fenix docs over at Flamingbird.com but didn`t find a text_z command.


@skeezix: the text automtically gets drawn above everything. That`s why I`m asking :D
 

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Another question regarding text: Is it possible to center a text? So it is always displayed in the middle of the screen?

I mean, when I use the write_int for example for displaying the score, I want that to be centered all the time.

I`m fiddling around with the move_text command but that doesn`t look good.


EDIT:
Another problem: I want to use this:

Code:
if(done==2 and key(_space))
       write(bla_font,100,160,0, "SAVING!");
       save("bla.cfg",temp);
       bla_menu();
       return;       
      end

to display a message before s score is saved, but it does not display the text, it just saves, then displays the text and goes back to the menu.

Is there any way to get this working?
 

Rik

Member
Joined
Dec 21, 2004
Messages
103
Age
38
Website
Visit site
To centre something you need to know it's width / height. If all your letters are the same width in your font this is easy to calculate.

screenwidth = 320;
screenheight = 240;
object_x = (screenwidth / 2) - (objectwidth / 2);
object_y = (screenheight/ 2) - (objectheight / 2);

As for your other problem, you could perhaps try setting a flag for saving, writing your text, and saving in the next loop.. for example:

if (saving == 1)
save("bla.cfg",temp);
saving = 0;
bla_menu();
return;
end
if(done==2 and key(_space))
write(bla_font,100,160,0, "SAVING!");
saving = 1;
end

Haven't used fenix for a while so the syntax might be wrong but maybe you can tell what I mean.
 
M

Marc_RC

Guest
Another question regarding text: Is it possible to center a text? So it is always displayed in the middle of the screen?

I mean, when I use the write_int for example for displaying the score, I want that to be centered all the time.

I`m fiddling around with the move_text command but that doesn`t look good.

write_int (font,x,y,centered,variable);

For example:

write_int(your_font,160, 120, 4, &your_score);

This will show with your font a text at the center of the screen (320x240/2=160x120). What's the number 4? The number 4 centers horizontally and vertically the text. Try to change that number and see the results. I don't know how to explain it, the practice makes the master ;)

Another problem: I want to use this:

Code:
if(done==2 and key(_space))
       write(bla_font,100,160,0, "SAVING!");
       save("bla.cfg",temp);
       bla_menu();
       return;       
      end

to display a message before s score is saved, but it does not display the text, it just saves, then displays the text and goes back to the menu.

Is there any way to get this working?
Yes, the problem is that you don't give time to show the text. Simply, add a FRAME; after the write line ;)
 
Last edited by a moderator:

paul55

Still Fresh
Joined
Apr 3, 2005
Messages
18
You should use text_z
It's like the z value for processes...
unfortunately this will affect all your texts! There's no way to write text with different z in fenix.

To be honest that is how div worked, but I'm pretty sure fenix is the same...
This is false, text_z in Fenix only affects z value for the new texts you want to write (i.e.: in Space Dodger the "PAUSE" text is over the "SCORE" and "LIVES" texts)
 
Last edited by a moderator:

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Thank you all very much!

I`ll try as soon is i can stop playing GTA San Andreas :D


@Rik: I`m tried already using the way you said about centering, but it gives no good results, cause the letters are not even in size.
And I already tried that flag thingie for the writing, doesn`t work either.

@Marc: THANKS! That worked like a charm! :)

@paul55: And thanks to you for pointing that out.
 

devlkore

^_^
Joined
Jul 15, 2004
Messages
274
Website
www.sparktasty.net
You should use text_z
It's like the z value for processes...
unfortunately this will affect all your texts! There's no way to write text with different z in fenix.

To be honest that is how div worked, but I'm pretty sure fenix is the same...
This is false, text_z in Fenix only affects z value for the new texts you want to write (i.e.: in Space Dodger the "PAUSE" text is over the "SCORE" and "LIVES" texts)

This is very interesting and useful info paul55, ThanX.

(I'm alive!)
 
Last edited by a moderator:
Top