Author Topic: Text width  (Read 404 times)  Share 

Totoro

  • Look behind you! A pink rabbit with a beak!
    • I can help with story design
    •  
    • I can help with voice acting
    •  
Text width
« on: 20 Mar 2004, 11:50 »
Hello :) Though I don't think I am a beginner anymore, the question seems to be so basic, or I am missing something really stupid, so I put it here...
WHen I have my character talk, the displayed speech stretches over the whole screen, but I don't like it that way. I want it to be put only over his head, using several lines if the text is too long. How can I set the maximald width (or length? I mean the maximal x-value-extension) of speech r displayed text?
« Last Edit: 20 Mar 2004, 11:53 by Totoro »

Scummbuddy

  • Mittens Knight
  • Give Stylish Confetti to BoZo - Wheee!
    • I can help with AGS tutoring
    •  
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
Re:Text width
« Reply #1 on: 21 Mar 2004, 16:30 »
From the manual:
DisplaySpeechAt
DisplaySpeechAt (int x, int y, int width, CHARID, string message)

Similar to DisplaySpeech, except that the text is displayed with its top left corner at (X,Y), in an area WIDTH wide.
You can use this function to write the character's speech text anywhere you like, and AGS will still play the character's talking animation and so on if appropriate.

NOTE: This function does not support QFG4-style speech.

Example:

DisplaySpeechAt (220, 20, 100, EGO , "My name is ego");

will display the message in the top right corner of the screen, and play the character's talking animation.
See Also: DisplaySpeech, DisplaySpeechBackground

- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Kinoko

  • Cartoonist/Illustrator/Great Lover
  • Kinoko worked on a game that was nominated for an AGS Award!
Re:Text width
« Reply #2 on: 21 Mar 2004, 23:56 »
But isn't there a way to just set the text width for that character? Because DisplayTextAt works fine until you have to write a dialogue, and for a main character, it could be extremely frustrating to have to set the width individually for every response to every interaction etc.

Moox

  • Losttraveler
Re:Text width
« Reply #3 on: 22 Mar 2004, 03:07 »
different sized fonts?

Radiant

  • Mittens Knight
  • AGS Baker
  • ...and we are the Dreamers of Dreams.
  • Radiant worked on a game that was nominated for an AGS Award!Radiant worked on a game that won an AGS Award!
Re:Text width
« Reply #4 on: 22 Mar 2004, 09:25 »
Simply write a function

Speak (int person, string text) {
   DisplaySpeechAt (character[person].x - 50, character[person].y - 20,
   100, person, text);
}

You'd have to add some checking to see if the x is close to either screen edge.