DgsSetAlpha

From Multi Theft Auto: Wiki
Revision as of 15:38, 16 January 2018 by Thisdp (talk | contribs)
Jump to navigation Jump to search

This changes the alpha level (the visibleness/transparency) of a DGS element

Syntax

bool dgsSetAlpha ( element guielement, float alpha )

Required Arguments

  • guiElement: the DGS element whose visibility is to be changed
  • alpha: The visibility/transparency of the DGS element. Ranges from 0 (fully transparent) to 1 (fully opaque). Default value is 0.80.

Returns

Returns true if the dgs element's alpha was successfully changed, false otherwise.

Example

This creates a DGS window and allows a player to change it's alpha (the visibleness/transparency) value with a command.

DGS = exports.dgs
myWindow = DGS:dgsCreateWindow ( 0.30, 0.10, 0.5, 0.60, "DGS window title", true )

--Add a command handler to change the alpha of the DGS window.
--Usage example: '/alpha 0.8', where 0.8 is stored as alphaAmount
function changeAlpha ( commandName, alphaAmount )
	alphaAmount = tonumber(alphaAmount)
	DGS:dgsSetAlpha ( myWindow, alphaAmount )
end
addCommandHandler ( "alpha", changeAlpha )

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