3D text draw?

Started by Kewun, Aug 08, 2016, 10:56 AM

Previous topic - Next topic

KAKAN

Quote from: Stormeus on Aug 08, 2016, 12:57 PM
Quote from: Murdock on Aug 08, 2016, 11:35 AMThere's nothing wrong, it's just bugged. I already reported 3D elements not working a while ago

It's not bugged. I've tested it in-game and it's worked fine. Chances are you have an invalid transform set.
Give us an example then.
oh no

Kewun

yes, give it pls :c

Stormeus

#17
COL_TEXT <- Colour(255, 255, 255);
COL_TEXTBG <- Colour(20, 20, 20);
COL_SCROLL <- Colour(50, 50, 50);
COL_WINDOW <- Colour(75,75,75);
COL_TITLEBAR <- Colour(10,10,10);
CONSOLE_ALPHA <- 192;

CONSOLE_FONT <- "Lucida Console";
WINDOW_FONT <- "Verdana";
TITLEBAR_FONT <- "Tahoma";

w <- 400;
h <- 450;

// Main console window
window <- GUIWindow(VectorScreen(75, 75), VectorScreen(w, h), COL_WINDOW, "", GUI_FLAG_TEXT_TAGS);
window.AddFlags(GUI_FLAG_VISIBLE | GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_WINDOW_TITLEBAR);

window.FontName = TITLEBAR_FONT;
window.FontSize = 10;
window.FontFlags = GUI_FFLAG_BOLD;
window.Text = "[#22ff22]MGUI[#d] Test Console";
window.TitleColour = COL_TITLEBAR;
window.Alpha = CONSOLE_ALPHA;

// Submit button
button <- GUIButton(VectorScreen(w - 65, h - 56), VectorScreen(50, 22), COL_WINDOW, "Submit", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
button.TextColour = COL_TEXT;
button.FontName = WINDOW_FONT;
button.FontSize = 11;
window.AddChild(button);

// Editbox
editbox <- GUIEditbox(VectorScreen(12, h - 56), VectorScreen(w - 86, 22), COL_TEXTBG, "", GUI_FLAG_NONE | GUI_FLAG_VISIBLE);
editbox.TextColour = COL_TEXT;
editbox.FontName = CONSOLE_FONT;
editbox.FontSize = 11;
window.AddChild(editbox);

// Memobox (actual console part)
memobox <- GUIMemobox(VectorScreen(12, 10), VectorScreen(w - 24, h - 74), COL_TEXTBG, GUI_FLAG_MEMOBOX_TOPBOTTOM | GUI_FLAG_VISIBLE);
memobox.TextColour = COL_TEXT;
memobox.FontName = CONSOLE_FONT;
memobox.FontSize = 10;
memobox.AddFlags(GUI_FLAG_TEXT_TAGS | GUI_FLAG_SCROLLABLE | GUI_FLAG_SCROLLBAR_HORIZ);
memobox.TextPaddingTop = 10;
memobox.TextPaddingBottom = 4;
memobox.TextPaddingLeft = 10;
memobox.TextPaddingRight = 10;
window.AddChild(memobox);

memobox.AddLine("[#22ff22]MGUI[#e] test console loaded!");
memobox.AddLine("Using [#ff0000][#uline]DirectX8[#e] renderer.");

window.AddFlags(GUI_FLAG_3D_ENTITY);
window.Set3DTransform(Vector(-674.337, 754.037, 10.9126), Vector(2.0, 1.0, 2.0), Vector(25.0, 25.0, 0.0));

This will create a transformed GUI console window outside the default spawn point.


:edit: Note the key lines:
window.AddFlags(GUI_FLAG_3D_ENTITY);
window.Set3DTransform(Vector(-674.337, 754.037, 10.9126), Vector(2.0, 1.0, 2.0), Vector(25.0, 25.0, 0.0));

The rotation and scale for a 3D transformation are also vectors.

Kewun


Kewun

lol <- GUILabel(VectorScreen(50,50),Colour(255,0,0),"shit!!!!!!!!!!!")
lol.AddFlags(GUI_FLAG_3D_ENTITY)
lol.Set3DTransform(Vector(-674.337,754.037,10.9126),Vector(2.0,1.0,2.0), Vector(25.0, 25.0, 0.0))
AddChild(lol)

cant get seem mine to working ;c still cant see label

KAKAN

That's GUIInstance.AddChild
oh no

Kewun

eh...

http://imgur.com/a/xOdV4

im retarded in guis, ill try configure it a little bit

KingOfVC


Sebastian

#23
Attaching the 3D textdraws to peds would be awesome.
Chat bubbles are very useful: chatting and playing is easier than ever.
(not talking about voice chatting)

https://youtu.be/jBekmg4jwSA

Shadow

@sseebbyy It is way easier to integrate, mainly if you have a FindPlayer() function for clientside.
QuotePS:is trash is ur home language??

Sebastian

#25
Hey Shadow! Good to "hear" you again.

Quote from: Shadow on Aug 08, 2016, 08:51 PM@sseebbyy It is way easier to integrate, mainly if you have a FindPlayer() function for clientside.

Still.. there must be a way.

Not really into the GUI, but maybe I will try to learn it some day, so you guys may expect some topics from me, just like in the "good" old Times.   :D

EK.IceFlake

Ee that will possible remove nametag from specific player... nice!

DizzasTeR

What @sseebbyy is talking about is also possible

Luis_Labarca

Quote from: Doom_Kill3R on Aug 08, 2016, 12:23 PMThere is always an alternate way
https://www.youtube.com/watch?v=p_vkR7oH7g8&feature=youtu.be#

hey bro could you give me the function of this function? Thank you
My server RP
IP: 51.222.28.159:8194

NewK

3D Scoreboards I added on the CTF server:





@Stormeus  A few issues I noticed so far:

- The windows show above almost everything. They show "above" the HUD (1st screenshot and 3rd screenshot), minimap radar (3rd screenshot), chatbox (3rd screenshot), scoreboard (when you press F5)  and player nametags (2nd screenshot).

- The "hitboxes" for most elements are displaced. If I add a button to a 3D Window and I try to click on it, it won't detect the click and sometimes if I click somewhere else on the screen (outside the window) it will detect as if I'm clicking that button. The same goes for window titlebars, if I try to drag the window, nothing will happen, it wont even detect that I'm clicking on it, yet sometimes if I try "dragging" somewhere else on the screen (outside the 3D window), I end up dragging the window as if I'm dragging it by its titlebar.