Chat bubbles issue

Posted by jdev
I've seen that there's a way to do this right now in GMS, like a built in feature, but it seems to not work entirely, like the text isn't center in the bubble. Can we expect a small bugfix, as this feature will be used by many.

Replies (4)

Last message on 25 Dec 2017

Size43 (Administrator) on 24 Dec 2017, 17:01:10
Since it's not a feature I ever intended to be supporting, I thing it might be easier to just release the code for it so everyone can edit it the way they want:

https://pastebin.com/1icFcyjR

This code would go right below or above the call to gms_draw. Don't forget to remove global.__chat_bubbles = true, if that's anywhere in your code.
jdev (Topicstarter) on 25 Dec 2017, 12:54:52
The thing that I've noticed with this code is that the text isn't centered within the chat bubble itself, it's slightly to the left, and by slightly I mean quite a bit. Still working on trying to center the text, but so far, not a lot of luck.
Size43 (Administrator) on 25 Dec 2017, 14:43:43
That might happen if the text alignment is not set to fa_left.

Try adding

draw_set_halign(fa_left)


before the draw_text_ext.
PenguinPalaceGame on 25 Dec 2017, 21:42:15
Tried this earlier but didn't seem to work for me, my method was to do this
draw_roundrect_colour(x - _w / 2 - 5, y - _h - sprite_height - 16, x + _w / 2 + 10, y - sprite_height - 6,c_white,c_white, false);
        draw_roundrect_colour(x - _w / 2 - 5, y - _h - sprite_height - 16, x + _w / 2 + 10, y - sprite_height - 6,c_black,c_black, true);
        draw_set_color(global.__chat_textcol);
        draw_text_ext(floor(x - _w / 2 +3), floor(y - _h - sprite_height - 8), last_chat_message, -1, _w);


(this will also draw an outline around the chat bubble to make it look a little cleaner)