DgsAddMoveHandler

From Multi Theft Auto: Wiki
Revision as of 01:22, 24 September 2018 by Thisdp (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

This function can make dgs element movable like a window.

Note: If applying move handler on dgs window, the original move handler will be replaced.

Syntax

string dgsAddMoveHandler( element dgsElement [, float x = 0,float y = 0, float width = 0, float height = 0, bool relativeX = true, bool relativeY = true, bool relativeW = true, bool relativeH = true ] )

Required Arguments

  • dgsElement: The dgs element you want to add move handler to.

Optional Arguments

  • x: A float of the 2D x position of the DGS move handler relative to the dgs element. This is affected by the relativeX argument.
  • y: A float of the 2D y position of the DGS move handler relative to the dgs element. This is affected by the relativeY argument.
  • width: A float of the width of the DGS move handler. This is affected by the relativeW argument.
  • height: A float of the height of the DGS move handler. This is affected by the relativeH argument.
  • relativeX: This is whether x position is relative. If this is true, then x floats must be between 0 and 1, representing sizes relative to the parent.
  • relativeY: This is whether y position is relative. If this is true, then y floats must be between 0 and 1, representing sizes relative to the parent.
  • relativeW: This is whether w position is relative. If this is true, then w floats must be between 0 and 1, representing sizes relative to the parent.
  • relativeH: This is whether h position is relative. If this is true, then h floats must be between 0 and 1, representing sizes relative to the parent.

Returns

Returns true if succeed, false otherwise

Example

DGS = exports.dgs
local button = DGS:dgsCreateButton(0.2,0.2,0.2,0.1,"test",true)
DGS:dgsAddMoveHandler(button,0,0,1,1)

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