Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: CTxCB on Sat 30/05/2015 00:23:41

Title: (SOLVED) Speech Bubble Text Window Problem
Post by: CTxCB on Sat 30/05/2015 00:23:41
Hey there, I haven't been here in ages. But I'm back with AGS and working on a more manageable game. I've got a problem with Text Windows. I'm using one to create a "Speech Bubble Effect" for something that isn't a character, but it's not giving me the desired look I'd expect.

Preview of Text Window GUI in AGS Editor.
(http://gyazo.com/f602c6915080cc8264310e0464238d18.png)

Top Left is 5Px X 5Px
Top Middle is 5Px X 5Px
Top Right is 5Px X 5Px
Middle Left is 5Px X 5px
Middle Right is 5Px X 5Px
Bottom Left is 10px X 11Px
Bottom Middle is 5Px X 11Px
Bottom Right is 5Px X 11Px

This is what the result is:
(http://i.gyazo.com/e893186c4500b6159abe487b31b2aed2.png)
Title: Re: Speech Bubble Text Window Problem
Post by: CTxCB on Sat 30/05/2015 00:25:44
(I accidentally quoted myself instead of modifying, accidental bump.)
Title: Re: Speech Bubble Text Window Problem
Post by: Khris on Sat 30/05/2015 02:04:46
After a lot of trial and error, I got it to work:

(http://i.imgur.com/IJG3bMm.png)
The wide padding on the left seems unavoidable; if you make any of the other left sprites smaller, the bottom one gets cut off again.

Here's the sprites I used: [imgzoom]http://i208.photobucket.com/albums/bb259/khrismuc/speech_bubble_zpshgkaapgh.png[/imgzoom](magenta = dimension)
Title: Re: Speech Bubble Text Window Problem
Post by: Gurok on Sat 30/05/2015 02:42:44
You *can* do it without wide padding on the left, but it's a bit tricky.

I started by centring the border (horizontally and vertically) in a 19x19 canvas and trimmed the edges to get this:

(http://i.imgur.com/OW0miRm.png)

This gives you:

(http://i.imgur.com/15BNMUB.png)

So my solution is... *drum roll* wide padding on all sides. Bear with me here though.

In 3.4, there's a padding value for TextWindowGUI you can adjust. The default is 3, but you can set it to 0 or even negative values. With a padding of -3, it looks like this:

(http://i.imgur.com/liW2XUF.png)

Admittedly, this requires 3.4 and might not be right for your project. The key differences between my sprites and Khris' are that my left sprites are the same width as my right sprites and my left sprites have a border the same distance from the right edge as my right sprites do from the left edge. Khris' are actually fine and a little more optimised if you can't do the fancy 3.4 padding thing.

The general rules I adhere to are: sprites on the left/right need to be the same width as each other and sprites on the top/bottom need to be the same height as each other. While there's room for variation, I've found if you stick to these rules, your images won't get chopped off.

Here are my sprites for anyone interested:

http://goo.gl/remRbV
Title: Re: Speech Bubble Text Window Problem
Post by: CTxCB on Sat 30/05/2015 03:04:34
Thanks! ;)