• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help edit buttons otclient

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
hello, that i need to move. it's badly positioned in client so i did this

have this button otui
Lua:
  UIButton
        size: 20 20
        image-source: /images/ui/buttons/minSettings
        image-clip: 0 0 20 20
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        @onClick: modules.client_options.toggle()

        $pressed:
          image-clip: 0 20 20 20
Code:
  UIButton
        size: 20 20
        image-source: /images/ui/buttons/minSettings
        image-clip: 0 0 20 20
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        margin-right: -20
        margin-bottom: -19
        @onClick: modules.client_options.toggle()

        $pressed:
          image-clip: 0 20 20 20

then client now has been moved to the position that i want but it does not work i¿on click noted that if i remove this
margin-right: -20
margin-bottom: -19
it get back to work, but it does not appear in the position that i want, so what should i do? help please
 
Edit image clip according to margins?
Not trying to necro, but this is exactly what i'm looking for.

How do I know what the margins are?

What I mean is,

Lets say I create this panel:
Lua:
FlatPanel
  id: helmetsChoicePanel
  margin-top: 10
  margin-bottom: 10

What would the correct margins be in the button config?

image-clip: 0 0 20 20

What does each of those digits represent, and how do I know where that places me on the screen? This may be a stupid question, but I'm confused pretty hard with otc at this point :D
 
First 2 numbers represents X, y positions, second 2 numbers size of element.
So, 0 0 is top left corner of image, and 20 20 is the width and height of clipped area.
 
Back
Top