How do I create speech bubbles?

Get help using Construct 2

Post » Tue Mar 01, 2016 12:18 am

I am able to create text, in a bubble... However. I want the bubble to chance size depending on the text. Also I want the text to automatically go on a new line when it goes too long.
No idea how to approach this, can anyone help me out?

What are these supposed to do and how do i use them.
Image
I'm trying to set the bubble size to text.textheight & text.textwidth but my bubble just dissappears.
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Tue Mar 01, 2016 1:14 am

Hi,
to change the size of your TextBox
TextBox > set size to width and height (could be an equation how big the text is and how many lines)
and of course you need to resize your bubble to (similar to textbox)

You can also wrap text, ...
Like if your text is coming from an array you could ask that after x letters make a new line (but wait for space or -)
so your textbox looks something like this
"some text from array " &newline& "the rest of the text"
Last edited by fm4fanAT on Tue Mar 01, 2016 1:17 am, edited 1 time in total.

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Tue Mar 01, 2016 1:16 am

TextHeight and TextWidth need a short time to work correctly. I suggest you use a wait action before changing size of your bubble
Image Image
B
25
S
14
G
138
Posts: 876
Reputation: 72,010

Post » Tue Mar 01, 2016 3:47 am

You are on the right track with using text height and text width...
but you would also probably need to add a certain number of pixels to the height and width of the bubble object to ensure the text is not overlapping the border of the bubble object.

for example...

one text update.-->
set 'bubble.width' to text.width+10 pixels
set "bubble.height' to text.height + 10 pixels


Also try using the 9-patch object for text bubbles...I findt hey work so much better than sprite objects because they expand to any size with no loss of detail or blurring...a very handy feature compared to regular sprites.
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Tue Mar 01, 2016 2:20 pm

this is as far as i can get without crying anyone wanna help me smooth this out a bit? ... like mostly i want to figure out how to delete that small delay? idk
Image
https://drive.google.com/file/d/0Bw7sth ... sp=sharing
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Tue Mar 01, 2016 4:08 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests