Posted By: sebbi91
[SOLVED] Text at a bone of a VIew-Entity / problem - 06/07/12 14:17
Hi guys,
I have a problem to set the position of a Text to a bone of a View-Entity.
Here is a Code-Snippet of my try to make it work.
//The View-Entity
ENTITY* user_menu=
{
type = "user_menu.mdl";
layer=2;
flags = SHOW|LIGHT|SHADOW;
flags2 =VISIBLE;
}
//Give View-Entitys a position
void activate_panels_startup()
{
user_menu.x=100; // deep
user_menu.y=-50; // X_screen
user_menu.z=15; // Y_screen
...
}
//my Text
TEXT* txt_build =
{
font=main_txt;
layer = 5;
string (user_menue_build);
flags = TRANSLUCENT | SHOW | ARIGHT;
}
//my programm to set the Position
void activate_Textes_startup()
{
VECTOR text_pos1;
vec_for_bone(text_pos1,user_menu,"Bone1");
vec_to_screen (text_pos1,camera1);
txt_build.pos_x=text_pos1.x;
txt_build.pos_y=text_pos1.y;
}
The Text appears but not at the Bone Position.
Any Idea?
Sorry if this is too easy and also sorry for my english^^.
Have a nice day.
best regards
Sebb
I have a problem to set the position of a Text to a bone of a View-Entity.
Here is a Code-Snippet of my try to make it work.
Quote:
//The View-Entity
ENTITY* user_menu=
{
type = "user_menu.mdl";
layer=2;
flags = SHOW|LIGHT|SHADOW;
flags2 =VISIBLE;
}
//Give View-Entitys a position
void activate_panels_startup()
{
user_menu.x=100; // deep
user_menu.y=-50; // X_screen
user_menu.z=15; // Y_screen
...
}
//my Text
TEXT* txt_build =
{
font=main_txt;
layer = 5;
string (user_menue_build);
flags = TRANSLUCENT | SHOW | ARIGHT;
}
//my programm to set the Position
void activate_Textes_startup()
{
VECTOR text_pos1;
vec_for_bone(text_pos1,user_menu,"Bone1");
vec_to_screen (text_pos1,camera1);
txt_build.pos_x=text_pos1.x;
txt_build.pos_y=text_pos1.y;
}
The Text appears but not at the Bone Position.
Any Idea?
Sorry if this is too easy and also sorry for my english^^.
Have a nice day.
best regards
Sebb