|
HudElem Position
|
|
Post: #1
|
|||
|
|||
|
HudElem Position
Hello,
i have a problem with the postioning of HudElem objects. When i wan't to set a HudElem (in this case: HUD_Text) for example on the right of another HudElem (in this case: HUD_Icon) it doesn't seem to calculate correct since the HUD_Text is inside the HUD_Icon instead of at the right. Also the position of Hud Elements alter on Clients too. My Calculation of the X-Position for HUD_Text is: CSHARP Code
I think the problem lies in different client-sided screen resolutions. So is it possible 1. to get the real coordinates/sizes of HudElem objects from a certain client or 2. to get screen values from a client? If not @zxz0O0 could you implement that? Example on Usage (Solution 1): CSHARP Code
Example on Usage (Solution 2): CSHARP Code
Or is there a other way to get the right Position for every clients? Maybe i just missed something ![]()
|
|||
|
Post: #2
|
|||
|
|||
|
RE: HudElem Position
Have you tried both SetString and SetLabel?
There isn't anyway to check for screen resolution or something, you need to use PointType but I've never found out how it works exactly. Just try a bit yourself and find the most close point to your absolute point. ![]() |
|||
|
Post: #3
|
|||
|
|||
RE: HudElem Position
(08-03-2012 10:10)zxz0O0 Wrote: Have you tried both SetString and SetLabel? The String and Label is both at the same position, so yes i tried both. I still don't get what PointType means but ok, good to know that it has something to do with that. Thx, i'll try playing with PointType |
|||
|
Post: #4
|
|||
|
|||
|
RE: HudElem Position
@Deviler86 If i'm not wrong, SetLabel is used for the label of the hud and SetString is used as a 'text' value if hud.Type = HudElementTypes.Text;
So if you want a string value that will frekently change use SetString not SetLabel (Someone mentionned a server crash with SetLabel abuse in a post i forgot ( Maybe @zxz0O0 ? )) I'm also searching for a way to find the client screen size... so if someone know how to get it please share it ![]() [Edit] In a plugin i've done, i used hudelement to show infos the players, i used hud.PointType = 0; for all of them and i changed only the hud.OriginY and hud.OriginX and the display was the same in 1920x1080 and 640x480
|
|||
|
Post: #5
|
|||
|
|||
RE: HudElem Position
(08-03-2012 19:45)narkos Wrote: @Deviler86 If i'm not wrong, SetLabel is used for the label of the hud and SetString is used as a 'text' value if hud.Type = HudElementTypes.Text; thx for the reply. The Reason i'm using SetLabel AND SetString is because i want different sizes of the Text. The text in SetLabel is a lil bigger than the text in SetString. I could use two HudElems for that, but i think thats better ^^. Since i don't have server crashes with SetLabel i'll stick to that, but if i notice problems i think i'll reconsider ^^ I'll try setting PointType to '0' too. I'm currently using '81' which i saw in another plugin (don't know which). Thx for the tipp |
|||
|
Post: #6
|
|||
|
|||
RE: HudElem Position
(08-03-2012 19:45)narkos Wrote: @Deviler86 If i'm not wrong, SetLabel is used for the label of the hud and SetString is used as a 'text' value if hud.Type = HudElementTypes.Text;Changing text too often, no matter if label or text will eventually crash the server since every new string is allocated in the memory. ![]() |
|||
The following 1 user says Thank You to zxz0O0 for this post:SailorMoon (08-04-2012) |
|
Post: #7
|
|||
|
|||
|
RE: HudElem Position
@zxz0O0 you mean that if i have a hud with a text like "hi all" then i change it to "hello everyone" the old text "hi all" still present in the memory?
|
|||
|
Post: #8
|
|||
|
|||
RE: HudElem Position
(08-04-2012 09:23)zxz0O0 Wrote:(08-03-2012 19:45)narkos Wrote: @Deviler86 If i'm not wrong, SetLabel is used for the label of the hud and SetString is used as a 'text' value if hud.Type = HudElementTypes.Text;Changing text too often, no matter if label or text will eventually crash the server since every new string is allocated in the memory. overflow -501 error?
Steam: jaydi2112
![]() ![]() ![]() |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Preview HudElem in game | [Z00MBY] Alex | 1 | 344 |
08-05-2012 23:16 Last Post: SailorMoon |
|
| Help HudElem disappear after map changes | narkos | 4 | 359 |
08-03-2012 20:21 Last Post: narkos |
|
User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder








![[-]](images/twilight/collapse.gif)
![[Image: azuw.jpg]](http://imageshack.us/a/img29/2668/azuw.jpg)


![[Image: userbar7q.gif]](http://img217.imageshack.us/img217/3686/userbar7q.gif)
![[Image: 45296.png]](http://img838.imageshack.us/img838/4203/45296.png)
![[Image: 3OM7E.gif]](http://i.imgur.com/3OM7E.gif)
