Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add BlackBox?
#1
Hi there,

i'm working on a Plugin in which i would like to add a BlackBox behind my menu.
I couldn't find a way to do so.
So now my question is if i can add something like that or (for example) display an icon and change it's rgb to 0,0,0.
Additional it would be nice to know how to do this.

I already tried using icons with an HudElem but the only thing i get to work with HudElem is a Text and Value type without any kind of background color. (hudelem.color only chances the fonts default color :/)
Reply

#2
Have you tried SetIcon("black"); ?
[Image: azuw.jpg]
Reply

#3
omg Y U NO i'm always thinking too complicated Troll

Thx, that was the solution Like a sir
Reply

#4
(08-02-2012, 19:13)Deviler86 Wrote: omg Y U NO i'm always thinking too complicated Troll

Thx, that was the solution Like a sir

Since nobody answered my question in the General Help Thread, i'll just post it here:

I have a problem displaying the blackbox and a text above it.
Sometimes the blackbox is drawn above the text instead of behind it. I tried editing OriginZ but that didn't help.

Can somebody give me a solution on how to display something above another thing constantly?
Reply

#5
Please share the code you are using.
[Image: azuw.jpg]
Reply

#6
(08-24-2012, 09:09)zxz0O0 Wrote: Please share the code you are using.

Ok here is the code i use (ClientInfo is a class that i wrote):

CSHARP Code
  1. private void CreateHUDs(int ClientNum)
  2. {
  3. ClientInfo clientInfo = new ClientInfo();
  4.  
  5. int menu = CreateHUD_Menu(ClientNum);
  6. int blackBox = CreateHUD_BlackBox(ClientNum);
  7.  
  8. clientInfo.HUD_Menu = menu;
  9. clientInfo.HUD_BlackBox = blackBox;
  10.  
  11. ClientInfos.Add(ClientNum, clientInfo);
  12. }
  13.  
  14. private int CreateHUD_Menu(int ClientNum)
  15. {
  16. HudElem hud = CreateNewHudElem();
  17. hud.Type = HudElementTypes.Text;
  18. hud.ShowToEnt = ClientNum;
  19. hud.HideInMenu = true;
  20. hud.Font = HudElementFonts.Default;
  21. hud.FontScale = 1f;
  22. hud.PointType = 0;
  23. hud.OriginY = 210f;
  24. hud.OriginX = -60f;
  25. hud.SetLabel(hiddenMenuText);
  26. hud.SetString("");
  27. return hud.HudElementNum;
  28. }
  29.  
  30. private int CreateHUD_BlackBox(int ClientNum)
  31. {
  32. HudElem hud = CreateNewHudElem();
  33. hud.Type = HudElementTypes.Icon;
  34. hud.ShowToEnt = ClientNum;
  35. hud.HideInMenu = true;
  36. hud.PointType = 0;
  37. hud.OriginY = 210f;
  38. hud.OriginX = -60f;
  39. hud.IconWidth = 136;
  40. hud.IconHeight = 110;
  41. return hud.HudElementNum;
  42. }


P.s.: I also tried creating the HUD-Elements in a different order but that didn't help.
Reply

#7
Thanks.

I will add sorting to the next update.
[Image: azuw.jpg]
Reply

#8
(08-25-2012, 09:05)zxz0O0 Wrote: Thanks.

I will add sorting to the next update.

thanks alot. i appreciate it Smile
Reply



Forum Jump:


Users browsing this thread:
4 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.