• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 draw_text_ext wrapping not working

D

DanjelRicci

Guest
Following the streak of my previous posts... The function draw_text_ext correctly wraps text in the standalone build, but not in the HTML5 build. Is this expected? The docs don't say anything about possible incompatibilities.
IDE v2.1.5.322, Runtime v2.1.5.246, tested both on Safari and Chrome, both with WebGL on and off.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
It is possible that behaviour for wrap detection is different between native and HTML5. I'd suggest to file a bug (yoyogames.com/bug) with an example project.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Is it just not wrapping or is it doing something "odd" that is different to the other platforms? I know that when using sprite fonts there may be an issue with newlines not being recognised correctly (this has been fixed and will be in a coming update)...

EDIT: I feel I should note that a major overhaul of HTML5 has been done and a (near) future update should resolve most of the issues people are having... I know that doesn't help you now but at least you know that the target has been getting some love and should be up-to-spec soon.
 
M

MarceloP

Guest
Hello again @DanjelRicci,

I know this seems strange because I answered your last post the same way but, I usually deploy things to HTML5 and I haven't faced this you're facing in 2.1.5.322. Although my codes were created before this update, I did update almost all of my games and in most of them I do use draw_text_ext without problems in HTML5.

Not to say I didn't have ANY problems, I had one with this same function and submitted a bug report, that recently was added to Mantis: https://bugs.yoyogames.com/view.php?id=29924

But this only happens if you start your string with spaces. If you don't it breaks perfectly on Standalone and HTML5. I also tried it on Firefox and Chrome, and I haven't had a problem with it. In fact, I have a text drawing object, and in the majority of time it does uses draw_text_ext. Are you doing anything different in HTML5? Is it the same text? Have you tried fixed values for it?

I hope I can help you pin it down, assuming that's not a real bug =X
 
D

DanjelRicci

Guest
I missed the mail notification for the replies, sorry guys!
Yes, we are using bitmap fonts, created this way:
global.SomeFont = font_add_sprite_ext(some font sprite, char list, true, 1);

After that, using fonts goes totally straightforward with draw_text or draw_text_ext. The only problem with HTML5 is that it doesn't automatically wrap, otherwise everything is fine. Actually, I solved by writing my own text box with a decent auto wrap, honestly I believe it may work fine for the rest of the project...

EDIT: I feel I should note that a major overhaul of HTML5 has been done and a (near) future update should resolve most of the issues people are having... I know that doesn't help you now but at least you know that the target has been getting some love and should be up-to-spec soon.
This is good news, thanks for sharing. I was about to open another HTML5 thread about fullscreen not getting input correctly... :p
I believe we will have to work on this HTML5 game for quite some time, so I'm glad to hear this.
 
Last edited by a moderator:
Top