Vice City: Multiplayer

Server Development => Scripting and Server Management => Client Scripting => Topic started by: KingOfVC on Nov 14, 2016, 03:45 PM

Title: 3D label
Post by: KingOfVC on Nov 14, 2016, 03:45 PM
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);
}
Title: Re: 3D label
Post by: DizzasTeR on Dec 02, 2016, 11:14 AM
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.
Title: Re: 3D label
Post by: MEGAMIND on Dec 28, 2016, 09:57 PM
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
Title: Re: 3D label
Post by: 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
Title: Re: 3D label
Post by: 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
Title: Re: 3D label
Post by: MEGAMIND on Dec 30, 2016, 06:58 AM
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.....!
Title: Re: 3D label
Post by: Radon on Jan 05, 2017, 02:19 PM
Try using this: [#ff320f] Note: This is just an example, Google color codes or something like that.
Title: Re: 3D label
Post by: EK.IceFlake on Jan 05, 2017, 02:51 PM
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