DgsMemoSeekPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function transform the position (index and line) correctly of the text in memo. ==Syntax== <syntaxhighlight lang="lua"> int int dgsDxMemoS...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int int dgsDxMemoSeekPosition ( element dxMemo, int index, int line [, bool transformLiine ] )
int int dgsMemoSeekPosition ( element dxMemo, int index, int line [, bool transformLine = true ] )
</syntaxhighlight>
</syntaxhighlight>


Line 13: Line 13:
*'''line:''' An integer of line to be transformed (line >= 1).
*'''line:''' An integer of line to be transformed (line >= 1).
===Optional Arguments===
===Optional Arguments===
*'''transformLiine:''' A bool indicates whether the line will be changed when the index is out of range in current line.
*'''transformLine:''' A bool indicates whether the line will be changed when the index is out of range in current line.


==Example==
==Example==
Line 20: Line 20:
DGS = exports.dgs  
DGS = exports.dgs  


memo = DGS:dgsDxCreateMemo(0.29, 0.30, 0.44, 0.04, "", true)
memo = DGS:dgsCreateMemo(0.29, 0.30, 0.44, 0.04, "", true)
DGS:dgsDxGUISetText(memo,[[
DGS:dgsSetText(memo,[[
This is a test script.
This is a test script.
Example
Example
Function: dgsDxMemoSeekPosition
Function: dgsMemoSeekPosition
]])
]])


local index,line = dgsDxMemoSeekPosition(memo,40,1)
local index,line = dgsMemoSeekPosition(memo,40,1)
outputChatBox("Old Value> Index = 40; Line = 1")
outputChatBox("Old Value> Index = 40; Line = 1")
outputChatBox("New Value> Index = "..index,,"; Line = "..line)
outputChatBox("New Value> Index = "..index,,"; Line = "..line)

Latest revision as of 15:29, 1 October 2019

This function transform the position (index and line) correctly of the text in memo.

Syntax

int int dgsMemoSeekPosition ( element dxMemo, int index, int line [, bool transformLine = true ] )

Required Arguments

  • dxMemo: The dgs-dxmemo you want to get the data from.
  • index: An integer of index to be transformed (index >= 0).
  • line: An integer of line to be transformed (line >= 1).

Optional Arguments

  • transformLine: A bool indicates whether the line will be changed when the index is out of range in current line.

Example

This example creates a combo box in the center of the screen.

DGS = exports.dgs 

memo = DGS:dgsCreateMemo(0.29, 0.30, 0.44, 0.04, "", true)
DGS:dgsSetText(memo,[[
This is a test script.
Example
Function: dgsMemoSeekPosition
]])

local index,line = dgsMemoSeekPosition(memo,40,1)
outputChatBox("Old Value> Index = 40; Line = 1")
outputChatBox("New Value> Index = "..index,,"; Line = "..line)

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