Labels?

Started by M, Mon 24/11/2003 23:58:02

Previous topic - Next topic

M

Just wrapping up a game, but theres one thing I cant seem to solve easily.

Similarly to when speech is displayed above a character's head, is there a way of making some form of text (like a label or something) appear during the game, which doesnt disappear after a certain time limit? I've been trying to work round this using DisplaySpeechBackground() in different ways, but I've come out with nothing.

Thanks

-Mike-

miguel

hi M,
you could use overlays to do it, write what you want with a paint program and save it as a sprite, then create a graphic overlay defining x,y positions to be on top of your character head.
it will follow your character untill you remove it,
check the manual for more info
Working on a RON game!!!!!

M

#2
Thanks for the reply. I was thinking that, but I want to put a lot of different text messages and might edit it at the last minute - thats a lot of bitmaps. I don't need the text to follow a character either, just sit staticly in the foreground.

(EDIT)
Another thing I was thinking of, was making another GUI just for this part, where theres a text object. But I'm not sure how to change its value to a set value defined from a room.

scotch

Why a graphic overlay when it's just text?

CreateTextOverlay (int x, int y, int width, int font, int color, string text)

sounds like it's what you're looking for.

M


Sounds promising, cheers. Until now, I didnt actually know you could do overlays like that. I should read the update lists next time.

miguel

sorry for the wrong answer, I was using graphic overlays when I came to the forums and noticed your post, I really wasn't thinking right!
text overlays will do the job much easier
miguel
Working on a RON game!!!!!

Scorpiorus

The CreateTextOverlay() returns an overlay id number so that you can change its text or remove the overlay:


// create three overlays:
int overlay1 = CreateTextOverlay (100, 100, 50, 2, 15, "text overlay 1");
int overlay2 = CreateTextOverlay (200, 100, 70, 2, 14, "text overlay 2");
int overlay3 = CreateTextOverlay (100, 200, 30, 2, 10, "text overlay 3");


//then later:
SetTextOverlay (overlay1, 100, 100, 50, 2, 15, "overlay 1 with new text");
SetTextOverlay (overlay2, 200, 100, 70, 2, 14, "overlay 2 with new text");


//and remove at some point:
RemoveOverlay(overlay1);
RemoveOverlay(overlay2);
RemoveOverlay(overlay3);


~Cheers

M

Thanks, thats sorted me right aat.

Quote from: miguel on Tue 25/11/2003 01:49:47
sorry for the wrong answer, I was using graphic overlays when I came to the forums and noticed your post, I really wasn't thinking right!

Thats ok. It still would have worked.

SMF spam blocked by CleanTalk