DgsEditSetMasked

From Multi Theft Auto: Wiki

This function sets or removes masking (covering up the text being typed) for password text fields.

Syntax

bool dgsEditSetMasked ( element theElement, bool status )

Required Arguments

  • theElement: The dgs edit box to be changed.
  • status: A boolean value indicating whether masking is to be enabled or disabled.

Returns

Returns true if the function is successful, false otherwise.

Example

This example creates a dgs edit box and an OK button. The user types in his password, and it checks if the password was correct

DGS = exports.dgs
-- set our password
password = "cheeseman"

-- create our button
button = DGS:dgsCreateButton( 0.7, 0.1, 0.2, 0.1, "OK", true )
-- create a dgs edit box and define it as "editBox"
editBox = DGS:dgsCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true )
-- ensure that it is masked
DGS:dgsEditSetMasked ( editBox, true )

-- set up our function to output the message to the chatbox
function checkPassword ()
        local text = DGS:dgsGetText ( editBox )     -- get the text from the edit box
        if text == password then                -- if the text matches the password
                outputChatBox ( "Password Correct!" )
        else
                outputChatBox ( "Password Incorrect!" )
        end
end
-- set the function to be called when the OK button is clicked
addEventHandler ( "onDgsMouseClick", button, checkPassword )

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Selector

Switch Button

Tab Panel

Window

Plugin

Blur Box

Color Picker

Canvas

Effect 3D

Media Browser

Mask

Nine Slice

Object Preview Supports

QRCode

Remote Image

Rounded Rectangle