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

OTClient How to use image cliping in otclient

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
1,049
Solutions
5
Reaction score
62
Trying to modifie the tooltip.lua so made a simple image
tooltip.webp
The problem im facing is that the tooltip background image always scaling dynamically with text size so it makes my image stretch so i was wondering how or if its even possible to dont affect the sides of the images so it wonth stretch and just instead apply slice scaling (image clipping) so basically it would add chunk by chunk from the middle something like here in this image example 1744716218777.webp

This is the code i wrote so far
LUA:
  addEvent(function()
    toolTipLabel = g_ui.createWidget('UILabel', rootWidget)
    local toolTipBase = g_ui.createWidget('TooltipPanel', toolTipLabel)
  toolTipBase:setVisible(false)
    toolTipLabel:setId('toolTip')
    toolTipLabel:setImageSource('/images/ui/popup/tooltip')
    toolTipLabel:setTextAlign(AlignCenter)
    toolTipLabel:hide()
  end)
end






  toolTipLabel:getChildById('tooltipBase'):setVisible(false)
  toolTipLabel:parseColoredText(text, "white")
  toolTipLabel:resizeToText()

  local paddedWidth = toolTipLabel:getWidth() + 30
  local paddedHeight = toolTipLabel:getHeight() + 10
  toolTipLabel:resize(paddedWidth, paddedHeight)
  end
  toolTipLabel:show()
  toolTipLabel:raise()
  toolTipLabel:enable()
  moveToolTip(true)
  g_effects.fadeIn(toolTipLabel, 10)
 

Similar threads

Back
Top