|
2 registered members (3run, 1 invisible),
3,839
guests, and 0
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Right use of vec_to_screen
#234618
11/03/08 21:25
11/03/08 21:25
|
Joined: Mar 2004
Posts: 286 Maintal, Deutschland
TheTommynator
OP
Member
|
OP
Member
Joined: Mar 2004
Posts: 286
Maintal, Deutschland
|
Hi,
I'm trying to find out the right use of vec_to_screen. I want the xy-coordinates of an entity (ball) on screen. But the manual doesn't describe how to do this. It just explains how to use it for checking if an entity is on screen or not.
So could anyone tell me how to use vec_to_screen to get the xy-coordinates of an entity on screen?
Thanks TheTommynator
Back @ work with 3DGS.
|
|
|
Re: Right use of vec_to_screen
[Re: Uhrwerk]
#234626
11/03/08 22:29
11/03/08 22:29
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
example useage:
action vts(){
VECTOR mypos;
TEXT* txt = txt_create(1,1);
txt.flags = VISIBLE;
(txt.pstring)[0] = "..text..";
while(1){
vec_set(mypos,my.x);//copy my position to vector "mypos"
vec_to_screen(mypos,camera);
txt.pos_x = mypos.x;
txt.pos_y = mypos.y;
wait(1);
}
}
attach this to an entity and the text will always placed on the entity(like names on npcs)
3333333333
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|