3D label

Started by KingOfVC, Nov 14, 2016, 03:45 PM

Previous topic - Next topic

KingOfVC

The function GUI.WorldPosToScreen seems broken to me. I'm trying to make a 2D text label in 3D space, but when I use this function to change the label's position, it seems infnitely far away.

Labul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "I LOVE IMKIKI"
    Labul.FontSize = 15;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    //Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
}

DizzasTeR

Wouldn't the label seem to be "infinitely far away" as its going to be visible anyway, wherever you are in the whole map since it will draw it on your screen. If I understood you correctly, then you need to add a distance check before its displayed and a little calculation to manage the label size. Make an inverse proportion of the size and distance of player from the position where you are creating the label.

MEGAMIND

#2
Labul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "I LOVE vcmp"
    Labul.FontSize = 15;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
} where to add color in this label and how o set vectors of difrnt locations

MEGAMIND

Quote from: MEGAMIND on Dec 28, 2016, 09:57 PMLabul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "I LOVE vcmp"
    Labul.FontSize = 15;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
} where to add color in this label and how o set vectors of difrnt locations
where do I add color to label?? And how do I add color to it

jWeb

Quote from: MEGAMIND on Dec 29, 2016, 10:24 PM
Quote from: MEGAMIND on Dec 28, 2016, 09:57 PMLabul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "I LOVE vcmp"
    Labul.FontSize = 15;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
} where to add color in this label and how o set vectors of difrnt locations
where do I add color to label?? And how do I add color to it

Did you just quote yourself? DAFUQ ;D

MEGAMIND

Quote from: jWeb on Dec 29, 2016, 10:59 PM
Quote from: MEGAMIND on Dec 29, 2016, 10:24 PM
Quote from: MEGAMIND on Dec 28, 2016, 09:57 PMLabul <- GUILabel();
 
function Script::ScriptLoad()
{
    Labul.Text = "I LOVE vcmp"
    Labul.FontSize = 15;
    Labul.Pos3D = Vector(497, -89.49429, 14);
    Labul.Rotation3D = Vector(2.0, 0, 3.1);
    Labul.Size3D = Vector(4, 5.0, 5.0);
 
}
 
function Script::ScriptProcess() {
  local wpts = GUI.WorldPosToScreen(Labul.Pos3D);
    Labul.Pos = VectorScreen(wpts.X, wpts.Y);
} where to add color in this label and how o set vectors of difrnt locations
where do I add color to label?? And how do I add color to it

Did you just quote yourself? DAFUQ ;D

its noot mine but  still its colorless.....!

Radon

Try using this: [#ff320f] Note: This is just an example, Google color codes or something like that.

EK.IceFlake

Quote from: Radon on Jan 05, 2017, 02:19 PMTry using this: [#ff320f] Note: This is just an example, Google color codes or something like that.
You also need GUI_FLAG_somethingCTRL