DgsNineSliceGetGrid: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} This function gets the grid position of DGS nine slice plugin. ==Syntax== <syntaxhighlight lang="lua"> float float float float dgsNineSliceSe...")
 
No edit summary
Line 9: Line 9:
</syntaxhighlight>  
</syntaxhighlight>  


[[Image:DGS_Nine_Slice.png|300px|thumb|Nine Slice Scaling]]
[[Image:DGS_Nine_Slice.png|200px|thumb|Nine Slice Scaling]]
===Required Arguments===
===Required Arguments===
*'''nineSlice:''' The nine slice element that you want to change the grid position.
*'''nineSlice:''' The nine slice element that you want to change the grid position.

Revision as of 05:27, 5 March 2020

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

Syntax

float float float float dgsNineSliceSetGrid( element nineSlice [, relative = false ] )
Nine Slice Scaling

Required Arguments

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

Optional Arguments

  • relative: A bool of whether the position of grid is ranging from 0 to 1 or just absolute pixels

Returns

Returns 4 float indifates the Left Grid,Right Grid,Top Grid and Bottom Grid.

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 )
gridXLeft,gridXRight,gridYTop,gridYBottom = DGS:dgsNineSliceGetGrid( nSlice, true )
outputChatBox("Left Grid:"..gridXLeft..";"Right Grid:"..gridXRight..";"Top Grid:"..gridYTop..";"Bottom Grid:"..gridYBottom)

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