• 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.

Question - Code draw_text/draw_text_ext [SOVLED]

Ax8472

Member
Right, sorry guys, it's another one of "those" questions. I'm hoping to god I'm just missing something simple.

So I'm trying to draw a line of string to my game screen. Naturally the first thing I tried was..

Create Event
text="This is a string and I can#line break any time I like".


Draw Event
draw_text(50,50,string(text))


But this didn't work. it just drew the flippin' hash hahahaha. Didn't even move the line down.

So I had a look in the manual for GMS2 and it says right there to use #, just like in 1.4. So I looked around the web and on these forums and I found that you can possibly use "\n" to break for a new line. So I tried that.

Capture.PNG


it didn't display it but it didn't break for a new line either.

Has anyone else encountered this? Am I just using the wrong code here?
 
S

Sp00nz

Guest
Just a heads up, the manual still displays we can use '#' symbol to make new lines.

In addition the example uses '!#' as the line break.

This is displayed under the draw_text page in the contained manual.

Another interesting point i found was the '#' symbol can still be used when its contained in an object but not a script...
Unless its only usable because it was my converted 1.x code...

Very strange o.o
 

Roderick

Member
That's a bug in the docs that I thought I'd fixed... I'll review all the draw text functions and make sure they are up to date. The correct way is explained here though: http://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/strings/index.html
@Nocturne, I was looking at that page and saw this:
2 digits of hex following a "0x", for example "\xff"
Should that be "\0xff" at the end? And is there a better place to report manual errors should we find them?

In addition the example uses '!#' as the line break.
No, the example is saying "Hello" + global.name +"!" then a line break, then the next line. But it's still out of date.
 
Q

Qarak

Guest
I just want to update, that in some documentation there's still the "#" instruction instead of the new ones. Maybe you already knew though.
I had been looking on the draw_text page for half an hour and couldn't figure out what I was doing wrong

EDIT: Oh woah this is a recent thread, I don't think it needed a bump. Just realized
 
Last edited by a moderator:
Top