Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, degenerate_762), 1,309 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to return the size of a TEXT? #367316
04/11/11 20:23
04/11/11 20:23
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
hi there,

I have 2 texts:

Code:
FONT text_font = "Arial", 1, 40;
TEXT menu_1
{
	font=inventory_menu_font;
	layer = 15;
	flags = NARROW,;
}
TEXT menu_2
{
	font=inventory_menu_font;
	layer = 15;
	flags = NARROW ;
}



I want the second text (menu_2) to be at the end of first text (menu_1).

But I don't know how to return the width of a text? Is there anyway to find the width of first text so I can use something like this:

menu_2.pos_x=menu_1 + menu_1.width; // or something like that?

is there anyway?


I don't care!
Re: How to return the size of a TEXT? [Re: Mahdi] #367320
04/11/11 22:03
04/11/11 22:03
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
That should be what you're looking for: http://www.conitec.net/beta/atext-size_y.htm


Always learn from history, to be sure you make the same mistakes again...
Re: How to return the size of a TEXT? [Re: Uhrwerk] #367355
04/12/11 12:37
04/12/11 12:37
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
I cann't use Size_x. Engine says parameter unknown. Only size_y works but i don't need that.

Why it says parameter unknown? Is there any other way?


I don't care!
Re: How to return the size of a TEXT? [Re: Mahdi] #367356
04/12/11 12:59
04/12/11 12:59
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,
If you want the size of a text for a known font, you can use str_width.


Re: How to return the size of a TEXT? [Re: 3dgs_snake] #367358
04/12/11 14:05
04/12/11 14:05
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Now that is a strange thing. I just had a look into the header file with the types and size_x and size_y are members of the TEXT struct. How did you try to access them?


Always learn from history, to be sure you make the same mistakes again...
Re: How to return the size of a TEXT? [Re: 3dgs_snake] #367365
04/12/11 14:41
04/12/11 14:41
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
Thanks, these functions are not within gs v7.05, so I updated to 7.86.

But now, engine says: Compiled without meshes!

I rebuilt the map via WED but the error is still there.


I don't care!

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

Gamestudio download | chip programmers | 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