About Store Forum Documentation Contact



Post Reply 
Getting width of GUI text
Author Message
Ceryni Offline
Member

Post: #1
Getting width of GUI text
hi,

i have this

Code:
((*(*t_test.tds).font).textWidth((*t_test.tds).spacing,"Test"))

but it always get stucked.

Any ideas?
(This post was last modified: 11-26-2011 08:41 PM by Ceryni.)
11-26-2011 08:21 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Getting width of GUI text
(*_*)

probably pointers are NULL
11-26-2011 10:26 PM
Find all posts by this user Quote this message in a reply
Ceryni Offline
Member

Post: #3
RE: Getting width of GUI text
i am a bit ill, so sorry

i did it directly when it was created so all pointers where pointing to0x000000 it works fine now

But is there a better way to place a text relative to the upper left corner?

if i do it like that

Code:
region_left+= t_resolution.create(Vec2(0.0f,-0.03f),"Resolution:");

only a part of the text is displayed.
so i want to get the size to place it at the right pos
(This post was last modified: 11-27-2011 05:29 PM by Ceryni.)
11-27-2011 05:27 PM
Find all posts by this user Quote this message in a reply
Dwight Offline
Silver Supporter

Post: #4
RE: Getting width of GUI text
You could always use "D.w()" and "D.h()" if you want to place text relative to the screen.

SnowCloud Entertainment - We are recruiting!
http://www.sc-entertainment.com
11-27-2011 08:38 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Getting width of GUI text
You can control text alignment with textds.align
11-27-2011 09:56 PM
Find all posts by this user Quote this message in a reply
Ceryni Offline
Member

Post: #6
RE: Getting width of GUI text
Thx.

thought align vec2(0,0) means upperleftcorner at pos 0,0 not center

vec2(1,0) and its fine
11-28-2011 04:06 PM
Find all posts by this user Quote this message in a reply
Post Reply