Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,733 guests, and 39 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Linebreak in draw_text ??? #224594
08/31/08 07:38
08/31/08 07:38
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi,

is it possible to use a linebreak in draw_text or do I have to split my string and use different draw_text-calls?

Regards,
Pegamode.

Re: Linebreak in draw_text ??? [Re: pegamode] #224601
08/31/08 08:08
08/31/08 08:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Line break for the draw_text command is
"\n"
Lower case N and carefully note the direction of the slash...

EG draw_text("First Line\nSecond Line",xxx,xxx) will display as
"First Line"
"Second Line"

Look up the formatting rules for PRINTF command and they should be the same for text manipulation.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Linebreak in draw_text ??? [Re: EvilSOB] #224693
08/31/08 19:51
08/31/08 19:51
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hmmm ...

this was the first thing I tried, but the \n was displayed and not converted into a linebreak.

Maybe the problem is that I read the string from a file ... I'll check that out again.

Re: Linebreak in draw_text ??? [Re: pegamode] #224695
08/31/08 20:08
08/31/08 20:08
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I checked it out ...

draw_text("First Line\nSecond Line",xxx,xxx) is doing fine.

But if I read the string that should be displayed from a file the \n is not converted into a linebreak ...

Any ideas?

Re: Linebreak in draw_text ??? [Re: pegamode] #224700
08/31/08 20:23
08/31/08 20:23
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
maybe try \r\n, just a guess.

Re: Linebreak in draw_text ??? [Re: DJBMASTER] #224722
08/31/08 22:07
08/31/08 22:07
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
interesting..

Is there a way to do this:

str("##############################")

now split the text after a count set by a variable (f.e. 10 signs) and add the "\n" between the 10 signs, the 20 signs, the 30 signs...etc...?

That´ll make scrollable text much easier ^^.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Linebreak in draw_text ??? [Re: Espér] #224789
09/01/08 08:04
09/01/08 08:04
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Splitting the string and adding "\n" should be easy ... but I'd like to avoid using many string operations as they are slow.

I prefer the direct way using "\n", but I don't know why it's not converted when reading the string from a file yet.

I'll try "\r\n" later on ... I hope that this doesn't cause into a linebreak in my textfile :-)

Re: Linebreak in draw_text ??? [Re: pegamode] #224820
09/01/08 11:43
09/01/08 11:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Also try "\\n" rather than "\n" in the FILE.
I think it may be losing the first "\" during the read process.
I havent tested thisd though.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Linebreak in draw_text ??? [Re: EvilSOB] #224822
09/01/08 11:54
09/01/08 11:54
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I think that is more exactly what happens ... I think my \n is escaped to \\n during the read process so that as a result \n is displayed instead of being converted into a linebreak.

But I'll check it out later.

Re: Linebreak in draw_text ??? [Re: pegamode] #224874
09/01/08 18:59
09/01/08 18:59
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Both "\r\n" and "\\n" are not working ...

I guess that the "\" is escaped to "\\" ...

Any more ideas ???

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1