DgsNineSliceSetGrid: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} This function changes the grid position of DGS nine slice plguin. ==Syntax== <syntaxhighlight lang="lua"> bool dgsNineSliceSetGrid( element n...")
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{Client function}}
{{Client function}}


This function changes the grid position of DGS nine slice plguin.
This function changes the grid position of DGS nine slice plugin.


==Syntax==  
==Syntax==  
Line 18: Line 18:
*'''gridYTop:''' A float of the position of top grid, depends on '''relative'''
*'''gridYTop:''' A float of the position of top grid, depends on '''relative'''
*'''gridYBottom:''' A float of the position of bottom grid, depends on '''relative'''
*'''gridYBottom:''' A float of the position of bottom grid, depends on '''relative'''
*'''relative:''' A bool of whether the position of grid is ranging from 0 to 1 or just absolute pixels
*'''relative:''' A bool of whether the position of grid is ranging from 0 to 1 or just absolute pixels of the texture


===Returns===
===Returns===
Line 28: Line 28:


yourTexture = dxCreateTexture("yourTexture")
yourTexture = dxCreateTexture("yourTexture")
nSlice = DGS:dgsCreateNineSlice( yourTexture, 0.2, 0.2, 0.35, 0.65 )
nSlice = DGS:dgsCreateNineSlice( yourTexture, 0.2, 0.2, 0.35, 0.65, true )
Image = DGS:dgsCreateImage( 100, 200, 500, 450, nSlice, false )
Image = DGS:dgsCreateImage( 100, 200, 500, 450, nSlice, false )
DGS:dgsNineSliceSetGrid( nSlice, 0.3, 0.3, 0.7, 0.7 )
DGS:dgsNineSliceSetGrid( nSlice, 0.3, 0.3, 0.7, 0.7, true )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Latest revision as of 05:28, 5 March 2020

This function changes the grid position of DGS nine slice plugin.

Syntax

bool dgsNineSliceSetGrid( element nineSlice [, float gridXLeft, float gridXRight, float gridYTop, float gridYBottom, bool relative = false ] )
Nine Slice Scaling

Required Arguments

  • nineSlice: The nine slice element that you want to change the grid position.

Optional Arguments

  • gridXLeft: A float of the position of left grid, depends on relative
  • gridXRight: A float of the position of right grid, depends on relative
  • gridYTop: A float of the position of top grid, depends on relative
  • gridYBottom: A float of the position of bottom grid, depends on relative
  • relative: A bool of whether the position of grid is ranging from 0 to 1 or just absolute pixels of the texture

Returns

Returns true if successful, false otherwise

Example

DGS = exports.dgs --get exported functions from dgs

yourTexture = dxCreateTexture("yourTexture")
nSlice = DGS:dgsCreateNineSlice( yourTexture, 0.2, 0.2, 0.35, 0.65, true )
Image = DGS:dgsCreateImage( 100, 200, 500, 450, nSlice, false )
DGS:dgsNineSliceSetGrid( nSlice, 0.3, 0.3, 0.7, 0.7, true )

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