• 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!

Problem with Position things OTClient

willdu

Active Member
Joined
Mar 11, 2017
Messages
91
Reaction score
25
How to create a side by side like on elfbot:
Spell Hi
healing.png


I tried:
Code:
Panel
  id: supportPanel
  anchors.left: parent.left
  anchors.right: parent.right
  anchors.top: parent.top
  padding-right: 10
  height: 440

  Label
    id: LightSpellLabelInfo
    width: 50
    !text: tr('Light:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 5
    margin-left: 5

  BotOptionLineEdit
    id: LightHealSpellText
    width: 100
    anchors.left: prev.left
    margin-top: 5
    margin-left: 55

  Label
    id: LightHealthQntLabel
    width: 50
    !text: tr('HP %:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 5
    margin-left: 155

  BotOptionLineEdit
    id: LightHealthQntLabel
    width: 30
    anchors.left: prev.left
    margin-top: 10
    margin-left: 185

  Label
    id: LightManaQntLabel
    width: 50
    !text: tr('MP %:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 5
    margin-left: 215

  BotOptionLineEdit
    id: LightManaQntLabel
    width: 30
    anchors.left: prev.left
    margin-top: 10
    margin-left: 265

  Label
    id: HeavySpellLabelInfo
    width: 50
    !text: tr('Heavy:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 20
    margin-left: 5

  BotOptionLineEdit
    id: HeavyHealSpellText
    width: 100
    anchors.left: prev.left
    margin-top: 20
    margin-left: 55

  Label
    id: HeavyHealthQntLabel
    width: 50
    !text: tr('HP %:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 20
    margin-left: 155

  BotOptionLineEdit
    id: HeavyHealthQntLabel
    width: 30
    anchors.left: prev.left
    margin-top: 10
    margin-left: 185

  Label
    id: HeavyManaQntLabel
    width: 50
    !text: tr('MP %:')
    anchors.left: prev.left
    anchors.top: prev.bottom
    margin-top: 20
    margin-left: 215

  BotOptionLineEdit
    id: HeavyManaQntLabel
    width: 30
    anchors.left: prev.left
    margin-top: 10
    margin-left: 265

But look whats happen
17eTAEy.png
 
You have a few problems:
1) Why you use margin left (static positioning) when you use dynamic positioning - anchors?
2) anchors.left: prev.left <- anchors.left for new object and it's ok, but in prev.left you use left side of previous object and it's wrong. You must refer to right side of previous object, because in your example you use one start value for two objects.

Use this function to show borders in your UI objects.
Code:
draw_debug_boxes()
 
You have a few problems:
1) Why you use margin left (static positioning) when you use dynamic positioning - anchors?
2) anchors.left: prev.left <- anchors.left for new object and it's ok, but in prev.left you use left side of previous object and it's wrong. You must refer to right side of previous object, because in your example you use one start value for two objects.

Use this function to show borders in your UI objects.
Code:
draw_debug_boxes()

Thank you, srry this too long, i was fixing by myserlf
 
Back
Top