DgsSetSize

From Multi Theft Auto: Wiki
Revision as of 03:54, 21 January 2018 by Thisdp (talk | contribs) (→‎Example)
Jump to navigation Jump to search

This function sets the dimensions (size) of a DGS element. It refers to the bounding box size for DGS elements. It does not make DGS elements smaller or larger in appearance.

Syntax

bool dgsSetSize ( element dgsElement, float width, float height, bool relative )

Required Arguments

  • dgsElement: the DGS element whose visibility is to be changed
  • width: The desired width setting for the dgs element
  • height: The desired height setting for the dgs element
  • relative: This is whether sizes and positioning are relative. If this is true, then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.

Returns

Returns true if the dgs element's size was set successfully, false otherwise.

Example

This example creates a dgs window and changes the x and y width of the window every 2 seconds.

DGS = exports.dgs
function changeWindowSize ( )
	--Called by the timer every 2 seconds. It decides an x and y width randomly between .1 and .5
	DGS:dgsSetSize ( myWindow, ( math.random( 10, 50 ) / 100 ), ( math.random( 10, 50 ) / 100 ), true )
end

--Create a dgs window called 'myWindow'
myWindow = DGS:dgsCreateWindow ( 0.3, 0.3, 0.5, 0.60, "DGS window title", true )
--Set a timer to change the window's size every 2 seconds, infinite times
setTimer ( changeWindowSize, 2000, 0 )

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