Jump to content

help with add img in gui row


Recommended Posts

hi

i hope you understand me

i want add a img of the weapon in gui row

client code

  
  
tab2 = guiCreateTab("Weapons",tabPanel) 
weapGrid = guiCreateGridList(4,6,305,291,false,tab2) 
guiGridListSetSelectionMode(weapGrid,0) 
weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) 
costColumn = guiGridListAddColumn(weapGrid,"$",0.3) 
weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) 
  
local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} 
for i,v in ipairs (weapons) do 
    local itemName = getWeaponNameFromID (v[1]) 
    local row = guiGridListAddRow (weapGrid) 
    guiGridListSetItemText (weapGrid, row, 1, itemName, false, true) 
    guiGridListSetItemText (weapGrid, row, 2, tostring(v[2]), false, true) 
end 
guiSetAlpha(weapGrid,1) 

in local weapons when i select id of the weapon 31 i want when i select the weapon see the img

i mean png img

how can i add img onto the weapon?

Link to comment

Sorry, I don't see any image funciton in your script, and here:

tab2 = guiCreateTab("Weapons",tabPanel) 
weapGrid = guiCreateGridList(4,6,305,291,false,tab2) 
guiGridListSetSelectionMode(weapGrid,0) 
weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) 
costColumn = guiGridListAddColumn(weapGrid,"$",0.3) 
weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) 
  
local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} 
for i,v in ipairs (weapons) do 
    guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 1, getWeaponNameFromID (v[1]), false, false) 
    guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 2, tostring(v[2]), false, false) 
end 
guiSetAlpha(weapGrid,1) 

Link to comment
Sorry, I don't see any image funciton in your script, and here:
tab2 = guiCreateTab("Weapons",tabPanel) 
weapGrid = guiCreateGridList(4,6,305,291,false,tab2) 
guiGridListSetSelectionMode(weapGrid,0) 
weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) 
costColumn = guiGridListAddColumn(weapGrid,"$",0.3) 
weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) 
  
local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} 
for i,v in ipairs (weapons) do 
    guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 1, getWeaponNameFromID (v[1]), false, false) 
    guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 2, tostring(v[2]), false, false) 
end 
guiSetAlpha(weapGrid,1) 

i mean i want add a img of the weapons

how i add img when i select the weapon i want show the img of the weapon

but where i can but the code???

Link to comment
I know you can't put an image in a GridList, so you could try putting the image somewhere on the tab

yes i know i cant put the image in a GridList

but how i make when i select weapn the img get show

how i bind if i select the weapon id 31 i want see the img on the right tap not on GridList

?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...