DgsSetSize: Difference between revisions
Jump to navigation
Jump to search
m (DGS (OOP Syntax)/(Template Organization) Mission) |
|||
Line 6: | Line 6: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool dgsSetSize ( element dgsElement, float width, float height, bool relative ) | bool dgsSetSize ( element dgsElement, float width, float height, bool relative ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP|It variables is a conjunction: | |||
*Relative: '''size.relative''' (set Relative property) | |||
*Width: '''size.w''' | |||
*Height: '''size.h''' | |||
|DGSElement:setSize||size|dgsGetSize}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 33: | Line 38: | ||
==See Also== | ==See Also== | ||
{{ | |||
===<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Functions</span>=== | |||
{{DGS General Functions}} | |||
===<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Events</span>=== | |||
{{DGS Events/General}} |
Revision as of 21:23, 16 April 2021
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 )
DGS OOP Syntax Help! I don't understand this!
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
General Functions
- dgsGetPosition
- dgsSetPosition
- dgsSetParent
- dgsGetParent
- dgsGetChild
- dgsGetChildren
- dgsGetSize
- dgsSetSize
- dgsGetType
- dgsSetLayer
- dgsGetLayer
- dgsSetCurrentLayerIndex
- dgsGetCurrentLayerIndex
- dgsGetLayerElements
- dgsGetProperty
- dgsSetProperty
- dgsSetPropertyInherit
- dgsGetProperties
- dgsSetProperties
- dgsGetVisible
- dgsSetVisible
- dgsGetEnabled
- dgsSetEnabled
- dgsGetPositionAlignment
- dgsSetPositionAlignment
- dgsGetAlpha
- dgsSetAlpha
- dgsGetFont
- dgsSetFont
- dgsGetText
- dgsSetText
- dgsGetPostGUI
- dgsSetPostGUI
- dgsGetInputEnabled
- dgsSetInputEnabled
- dgsGetInputMode
- dgsSetInputMode
- dgsAttachToAutoDestroy
- dgsDetachFromAutoDestroy
- dgsFocus
- dgsBlur
- dgsCreateFont
- dgsBringToFront
- dgsMoveToBack
- dgsGetScreenSize
- dgsGetCursorPosition
- dgsGetMouseEnterGUI
- dgsGetMouseLeaveGUI
- dgsIsMouseWithinGUI
- dgsSetSystemFont
- dgsGetSystemFont
- dgsGetElementsInLayer
- dgsGetElementsFromResource
- dgsGetFocusedGUI
- dgsImportFunction
- dgsImportOOPClass
- dgsG2DLoadHooker
- dgsSetRenderSetting
- dgsGetRenderSetting
- dgsSimulateClick
- dgsGetRootElement
- dgsAddMoveHandler
- dgsRemoveMoveHandler
- dgsIsMoveHandled
- dgsAddSizeHandler
- dgsRemoveSizeHandler
- dgsIsSizeHandled
- dgsAttachElements
- dgsDetachElements
- dgsElementIsAttached
- dgsAddPropertyListener
- dgsRemovePropertyListener
- dgsGetListenedProperties
- dgsSetMultiClickInterval
- dgsGetMultiClickInterval
- dgsSetMouseStayDelay
- dgsGetMouseStayDelay
- dgsCenterElement
- dgsSetElementKeeperEnabled
- dgsGetElementKeeperEnabled
- dgsSetClickingSound
- dgsGetClickingSound
- dgsSetClickingSoundVolume
- dgsGetClickingSoundVolume
General Events
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange