https://wiki.multitheftauto.com/wiki/GUI_Classes/CheckBox:Create?feed=atom&action=historyGUI Classes/CheckBox:Create - Revision history2024-03-28T14:32:07ZRevision history for this page on the wikiMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=GUI_Classes/CheckBox:Create&diff=18489&oldid=prev50p: /* example to be added */2009-03-01T14:43:09Z<p><span dir="auto"><span class="autocomment">example to be added</span></span></p>
<p><b>New page</b></p><div><pageclass class="client" subcaption="GUI Class method"></pageclass><br />
__NOTOC__ <br />
This function creates a [[Element/GUI/Checkbox|CheckBox]] object.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
checkboxObject CheckBox:Create ( float x, float y, float width, float height, string text, bool selected, [ bool relative = false, element parent = nil] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''x:''' A float of the 2D x position of the checkbox on a player's screen. This is affected by the ''relative'' argument.<br />
*'''y:''' A float of the 2D y position of the checkbox on a player's screen. This is affected by the ''relative'' argument.<br />
*'''width:''' A float of the width of the text field next to the checkbox. This is affected by the ''relative'' argument.<br />
*'''height:''' A float of the height of the text field next to the checkbox. This is affected by the ''relative'' argument.<br />
*'''text:''' The text to be displayed next to the checkbox.<br />
*'''selected:''' A boolean representing whether the checkbox created should be selected by default.<br />
<br />
===Optional Arguments=== <br />
{{OptionalArg}} <br />
*'''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 measures relative to the parent. Default value is '''false'''<br />
*'''parent:''' This is the parent that the checkbox is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.<br />
<br />
===Returns===<br />
*'''checkboxObject''' if it was created succesfully <br />
*'''false''' otherwise. <br />
<br />
==Example== <br />
<!-- Explain what the example is in a single sentance --><br />
This example does...<br />
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --><br />
<syntaxhighlight lang="lua"><br />
<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
[[GUI_Classes|Back to GUI Classes page]]<br />
{{GUI_Classes_allfunctions}}</div>50p