DgsGetCurrentLayerIndex: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(DGS (OOP Syntax)/(Template Organization) Mission)
m (DGS OOP Syntax changing)
 
Line 7: Line 7:
integer dgsGetCurrentLayerIndex( element dgsElement )
integer dgsGetCurrentLayerIndex( element dgsElement )
</syntaxhighlight>
</syntaxhighlight>
{{DGS/OOP||DGSElement:getCurrentLayerIndex|||dgsSetCurrentLayerIndex}}
{{DGS/OOP|
    Method = DGSElement:getCurrentLayerIndex|
    Counterpart = dgsSetCurrentLayerIndex
}}


[[Image:DGSRenderLayer.png|300px|thumb|DGSRenderLayer]]
[[Image:DGSRenderLayer.png|300px|thumb|DGSRenderLayer]]

Latest revision as of 19:36, 3 May 2021

This function allow us to get the render layer index of a dgs element.

Syntax

integer dgsGetCurrentLayerIndex( element dgsElement )

DGS OOP Syntax Help! I don't understand this!

Method: DGSElement:getCurrentLayerIndex(...)
Counterpart: dgsSetCurrentLayerIndex
DGSRenderLayer

Required Arguments

  • dgsElement: The DGS element to set.

Returns

Returns an integer if succeed, false otherwise.

Example

DGS = exports.dgs

window1 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 1",false)	--Create window1
window2 = DGS:dgsCreateWindow(400,100,200,200,"DGS Window 2",false)	--Create window2
local index1 = DGS:dgsGetCurrentLayerIndex (window1) --Get the layer index of window1
local index2 = DGS:dgsGetCurrentLayerIndex (window2) --Get the layer index of window2
outputChatBox(index1) --Because window 1 is created earlier than window2, so its index should be smaller than index2
outputChatBox(index2)

See Also

General Functions

General Events