(SOLVED) Speech Bubble Text Window Problem

Started by CTxCB, Sat 30/05/2015 00:23:41

Previous topic - Next topic

CTxCB

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.


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:

CTxCB

#1
(I accidentally quoted myself instead of modifying, accidental bump.)

Khris

After a lot of trial and error, I got it to work:


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)

Gurok

#3
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:



This gives you:



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:



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
[img]http://7d4iqnx.gif;rWRLUuw.gi

CTxCB


SMF spam blocked by CleanTalk