DgsGridListSetItemImage

From Multi Theft Auto: Wiki
Revision as of 12:56, 24 February 2018 by Thisdp (talk | contribs) (Created page with "{{Client function}} This function sets the image on a grid list item. ==Syntax== <syntaxhighlight lang="lua"> bool dgsGridListSetItemImage( element gridList, int rowIndex,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function sets the image on a grid list item.

Syntax

bool dgsGridListSetItemImage( element gridList, int rowIndex, int columnIndex, element texture [, int color = 0xFFFFFFFF, float offsetX = 0, float offsetY = 0, float width, float height)
dgsGridListSetItemImage(gridlist,row,column,image,color,offx,offy,w,h)
Item Image

Required Arguments

  • gridList: the grid list containing the item you're interested in.
  • rowIndex: the row index of the item.
  • columnIndex: the column index of the item.
  • data: the data you want to set.

Returns

Returns true if set successfully, false if one of the arguments was invalid.

Example

This example displays a random item data from the gridlist.

DGS = exports.dgs
function clientsideResourceStart ()
    local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
    local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
    if ( column ) then
        local row = DGS:dgsGridListAddRow ( numberList )
        local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ) )
        DGS:dgsGridListSetItemData ( numberList, row, column, "Test" )
        local myItemData = DGS:dgsGridListGetItemData ( numberList, row, column )
        outputChatBox ( "My gridlist item data: " .. myItemData )
    end
end
addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart )

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips