Jump to content

mode image

Not a Bug 1.3.5

BenDer
BenDer

Posted

Hello, please fix the mode image because I moved it to a convenient place and it turned out not to be tied to the size of the player's interface and for some it is not where it should be

image.png

image.png

Mr01sam

Posted

It can be tied to a player's user interface, the anchor points just need to be set correctly. If you want it to appear in the top right corner you need to have the AnchorMin AnchorMax OffsetMin and OffsetMax values for the background set to the following...

      "Background": {
        "Color": "0 0 0 0",
        "Image": null,
        "UseRawImage": false,
        "AnchorMin": "1 1",
        "AnchorMax": "1 1",
        "OffsetMin": "-32 -32",
        "OffsetMax": "0 0"
      },

The above values should position it in the top right corner, and make it 32x32 pixels big. When the player's UI changes, it will stay anchored to the top right corner.

(Ignore the rest of this post if you just wanted the fix, I will explain what these values mean.) Here is a quick reference of what each anchor point value is, notice that in your example, I set both AnchorMin and AnchorMax to 1,1 (which is top right). Then for the OffsetMin and OffsetMax (which are in pixels), I set the OffsetMin to -32 -32, this is because if you can imagine a box that starts at the top right part of the screen, if we want that box to be visible, the minimum coordinates of that box should be 32 pixels (to the left) and 32 pixels (toward the bottom).

This is how every plugin that has a custom UI positions its elements, it gives you the most flexability and allows you to make sure it will scale well with the user interface. If you need some more documentation, umod has a link explaining this as well: https://umod.org/guides/rust/basic-concepts-of-gui
image.png.e6000d3cbbdc8aedecfb4c00a9d302b2.png

Hope that helped! Let me know if you need help making tweaks.

  • Love 1
Mr01sam

Posted

Changed Status from Pending to Not a Bug

1.6m

Downloads

Total number of downloads.

7.7k

Customers

Total customers served.

115.4k

Files Sold

Total number of files sold.

2.3m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.