Post new topic    
Liquid Metal Slime
Send private message
Is there a way to create overlapping textboxes? 
 PostFri Jun 06, 2014 3:00 pm
Send private message Reply with quote
I want to create overlapping textboxes so that I can make an "interruption" from one textbox to the next.

An example of what I mean:

Code:

  |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
  |Hello, my name is John. Welcome to our  |
  |peaceful town. Nothing bad ever seems   |
  |to happen he|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|         |
  |____________|   GODZILLA!     |_________|
               |_________________|



... I hope this displays right for everyone as I'm not sure if the font is monospaced. Also there is no Godzilla in my game. This is purely an example for the sake of getting my point across.

EDIT: Turns out it's not monospaced... took a lot of trial and error to get this to display right on my screen.

Essentially I want to display textbox #1, then after a few seconds of giving the player a chance to read it, textbox #2 will pop up and overlay #1. Currently when I attempted this with my script, #1 vanishes the instant that #2 appears.

Another thing I want is for the textbox #2 to have a smaller width than #1. Is there any way of doing so? I couldn't figure out anything like this in the editor.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal King Slime
Send private message
 
 PostFri Jun 06, 2014 4:26 pm
Send private message Reply with quote
You need to use scripts.

Doing this with scripts involving slices is a cake walk.
Liquid Metal Slime
Send private message
 
 PostFri Jun 06, 2014 4:28 pm
Send private message Reply with quote
Spoonweaver wrote:
You need to use scripts.

Doing this with scripts involving slices is a cake walk.


So I'd basically have to have textbox slice which would be set to appear at a certain screen (x,y). Do you know if there's any tutorials of this?
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal King Slime
Send private message
 
 PostFri Jun 06, 2014 4:30 pm
Send private message Reply with quote
This sounds like a job for slice collections.

Since by default, slices appear underneath text boxes, probably the easiest way to do this is with two slice collections, and no text boxes at all.

Making a slice collection that looks like a text box is pretty easy. You want a rectangle slice with a wrapping text slice as child. Set the text slice to "Fill Parent: YES" and adjust the padding on the rectangle to add a little space between the edges of the rectangle and the text slice inside.

Then you can display them like this:

Code:

plotscript, fake interrupting text boxes, begin
  variable(b1, b2)
  b1 := load slice collection(6)
  wait for key(usekey)
  b2 := load slice collection(7)
  wait for key(usekey)
  free slice(b2)
  free slice(b1)
end


This will *almost* look just like a textbox being interrupted by another.

The only visible difference is going to be that the lines of the textbox will appear all at once, rather than quickly line-by-line like a real textbox.

if you want that effect, it can be scripted too, but it won't be such a tiny simple script anymore :)
Liquid Metal King Slime
Send private message
 
 PostFri Jun 06, 2014 4:31 pm
Send private message Reply with quote
Well, the easier way to do this would be to set up a script that displays the first textbox. Then runs a short wait command. Then displays another textbox. This seconds textbox would actually be blank, but would have a backdrop that displays the old textbox with the new textbox on top, using backdrop transparency to still show the on screen character action. You would also likely need to suspend the player's textbox advance for a bit, so they don't skip ahead of the effect.


EDIT: or bob's way I suppose.
Liquid Metal Slime
Send private message
 
 PostFri Jun 06, 2014 4:37 pm
Send private message Reply with quote
Both ways sound good to me. I'll give them a try later on. I may go with Spoons way just so I can retain the text-scrolling effect, then interrupt it with the backdrop.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostFri Jun 06, 2014 5:36 pm
Send private message Reply with quote
Wouldn't be easiest of all to just make the "Godzilla" slice collection, load it up and then parent it to the "text box box" after a tick or two's wait time?

Code:
lookup slice(sl:textbox box)
Liquid Metal Slime
Send private message
 
 PostSat Jun 07, 2014 4:24 am
Send private message Reply with quote
sotrain515 wrote:
Wouldn't be easiest of all to just make the "Godzilla" slice collection, load it up and then parent it to the "text box box" after a tick or two's wait time?

Code:
lookup slice(sl:textbox box)


Sounds like a legitimate solution and easiest as far as slices go. Thanks.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostSat Jun 07, 2014 5:01 am
Send private message Reply with quote
You can parent the slice to a number of different textbox slices. Attaching it to the box means that it will be positioned relative to the box, of course. You can also attach it to the outermost container of the textbox (sl:textbox root) or to the "textbox layer" slice (sl: textbox layer) if you want to give it an absolute position on the screen. Not: if you parent it the textbox layer then it will not be automatically deleted when the textbox is closed, and will appear under textboxes opened later. If you attach it to any other textbox slice then it will be automatically deleted, and you shouldn't call freeslice if it's already delete.
Display posts from previous: