knightxd
Member
how can i use multiple backgrounds for items?
on \data\images\ui theres item.png, that is used as background for all items, does anyone know how can i edit it? to make multiple backgrounds depending on slot?
thanks!
in code.lua
on \data\images\ui theres item.png, that is used as background for all items, does anyone know how can i edit it? to make multiple backgrounds depending on slot?
thanks!
-- SOLVED -- SOLUTION:
in code.lua
Code:
function onInventoryChange(player, slot, item, oldItem)
if slot >= InventorySlotPurse then return end
local itemWidget = inventoryPanel:getChildById('slot' .. slot)
if itemWidget then
if item then
itemWidget:setImageSource('/images/ui/itemB') -- this sets the source if item is on slot
itemWidget:setItem(item)
else
itemWidget:setStyle(InventorySlotStyles[slot])
itemWidget:setItem(nil)
end
end
end
Last edited: