Dark background behind comments/texts

  • #1, by marvelFriday, 10. March 2017, 15:39 8 years ago
    Hey Guys,
    does anybody know how to realize a darkened area behind the texts (that are displayed when a character speaks)? smile

    Any help on that ist appreciated.

    Key Killer

    599 Posts


  • #2, by afrlmeFriday, 10. March 2017, 15:51 8 years ago
    Is the text above the characters heads or in a forced position somewhere else? If you force the text position it would be much easier to sort out.

    As for dynamically displaying a black background to fit the length of the text... maybe that would be possible in VS5 with the new masking thing? You could query the amount of characters in the current text then display black image & mask it to length you need it - possibly... I don't know.

    P.S: as an after thought what about applying a large stroke around the text? If you make it large enough then it will create a black rectangle around the text, though it won't look as nice as semi-transparent rectangle, but it's the fastest, easiest method.

    Imperator

    7285 Posts

  • #3, by F_KalFriday, 10. March 2017, 16:07 8 years ago
    I haven't tried it, but perhaps a bitmap font that has solid black background behind every character(letter)?
    (Also not sure if this would work with a semi-transparent background)

    Forum Fan

    107 Posts

  • #4, by marvelFriday, 10. March 2017, 16:30 8 years ago
    Yes, a small blackened area behind the text above the characters heads. smile

    I wonder how the guys of "wild wild pixel" did it with Visionaire. See here:

    Key Killer

    599 Posts

  • #5, by sebastianFriday, 10. March 2017, 16:35 8 years ago
    Assuming you display the text "classical" above the head:

    You could do it by displaying an interface behind the text which itself has for each possible displayed line one several button under another which have darker alpha-channel graphic to visualize your darkened area..

    Then when displaying character text you could use a LUA function to hook into the startText / stoptext and run a function to display the interface at characters location.x - 1/2 width of character text ; location.y- character height - additional hight. and maybe also reposition the characters text to the same offset. 

    Now determning how much text gets displayed so you can trigger which buttons in the interface should be shown to display the darker area. This is difficult because you can't only count the chars in the active text and devide it by the max. amounts of characters in one line. Thats because longer words which overflow the max. line width of the font get automatically pushed in the next line and also some characters are wider than others.

    So either you need some override function which adds an additional background line to the "speechbubble" for specific reasons which you have to manually call or your line-count function has to calculate the lines by checking each character in the active text and its FontLetters and FontLetterSpacing,etc from the Font Data Structure field to determine when a new line gets drawn and by that activating a new interface button graphic. 

    Same procedure goes for normal speach bubbles i guess.

    ~Sebastian

    PS: I guess in WildWildPixel they called an action for displaying manually a speechbubble in which the text fits.

    Thread Captain

    2346 Posts

  • #6, by afrlmeFriday, 10. March 2017, 17:33 8 years ago
    hmm... did they even use display text? Looks more like images to me, but I could be wrong.

    Imperator

    7285 Posts

  • #7, by sebastianFriday, 10. March 2017, 18:14 8 years ago
    thought so, too at first. 
    But the text is moved independantly from the speechbubble if you look closely. 
    I don't think they did two animations and overlap them above each other. But who knows...

    Thread Captain

    2346 Posts

  • #8, by afrlmeFriday, 10. March 2017, 18:50 8 years ago
    thought so, too at first. 
    But the text is moved independantly from the speechbubble if you look closely. 
    I don't think they did two animations and overlap them above each other. But who knows...
    I suppose if you limit the amount of characters per line & your overall text, then you should be able to getaway with a single speech bubble or one for left & right. Using images is an alternative solution, which would be great if you want to stylize the text like they do in comic books / graphic novels or change the color of certain words, add bold / italic, etc. but overall it would be a lot more work. Depends on what he has in mind.

    Simplest solution though would be to force the text to a bounding box at the top or bottom of the screen.

    Imperator

    7285 Posts