The Daily Click ::. Forums ::. Klik Coding Help ::. Multiple Formats in the Same Paragraph
 

Post Reply  Post Oekaki 
 

Posted By Message

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
28th June, 2004 at 16:47:22 -

Using MMF's string object, is there any way to change format in the middle of a paragraph? While writing dialogue, I want to have some words or phrases itallicized for emphasis, but while leaving the rest of the sentence normal.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
28th June, 2004 at 16:51:39 -

Not the normal string object, but try Formatted Text or Rich Edit.

 
- Tigerworks

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
29th June, 2004 at 17:22:50 -

Thanks. Before adding Formatted Text, I adapted Dine's comment in this article: http://www.create-games.com/article.asp?id=378 , with the ability to automatically finish a paragraph through fastloop, insertable pauses, and having the user determine when to go on when it's finished a paragraph. All text is contained in one string with multiple paragraphs. How do you actually add letters/strings to the formatted text object? Here's a truncated version of the normal typing code:

Every .05 seconds + "Pause" <> 0 + Mid$( paragraph$( "String", value( "Step" ) ), value( "Letter" ), 1 ) <> "&" (the pause) or "#" (the end of the paragraph) --> Formatted Text(Insert Mid$( paragraph$( "String", value( "Step" ) ), value( "Letter" ), 1 ). If the current letter in String's paragraph "Step" to be transfered isn't a # or &, and the paragraph hasn't ended, then add it to the Formatted Text object.

Every .05 seconds + "Pause" <> 0 --> add 1 to "Letter"

Mid$( paragraph$( "String", value( "Step" ) ), value( "Letter" ), 1 ) = "#" --> set "Pause" to 1.

However, there is no action whatsoever onscreen. This code worked with a second string object doing the outputting, but I can't seem to get the Formatted Text to work. Once that happens, I need to figure out how to make words before or after another special character italic (maybe keep track of what word it's on by adding to a counter every space and use the select word, word->text->italic, but I'm getting ahead of myself). Alternatively, how do you get rid of the mouse features (cursor changes, highlighting, non-transparent background) of the Rich Edit Object?

Image Edited by the Author.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
   

Post Reply



 



Advertisement

Worth A Click