<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Whitee</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Whitee"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Whitee"/>
	<updated>2026-04-23T20:06:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_edit&amp;diff=71652</id>
		<title>Resource:Custom edit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_edit&amp;diff=71652"/>
		<updated>2021-08-12T11:13:40Z</updated>

		<summary type="html">&lt;p&gt;Whitee: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This resource allow you to create custom editbox.&lt;br /&gt;
Download [https://github.com/sirphantasm/custom_edit GitHub].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: sirphantasm&lt;br /&gt;
&lt;br /&gt;
==Exported functions/events==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Functions/Events&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
By this function you can create new editbox with variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool createCustomEdit(string default-text, float x, float y, float z, bool postgui, string placeholder, bool masked, filepath font, table activecolor, table fontcolor table backgroundcolor, table caretcolor, bool visible, number length, number fontsize)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''text:''' Default text to draw in the editbox. Recommended &amp;quot;&amp;quot;.&lt;br /&gt;
*'''x:''' A float of the 2D screen x position.&lt;br /&gt;
*'''y:''' A float of the 2D screen y position.&lt;br /&gt;
*'''width:''' A float of the 2D screen y position.&lt;br /&gt;
*'''heigth:''' A float of the 2D screen y position.&lt;br /&gt;
&lt;br /&gt;
====Optional arguments====&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''postGUI:''' A bool representing whether the text should be drawn on top of or behind any ingame GUI (default false).&lt;br /&gt;
*'''placeHolder:''' A string of the placeholder text of editbox (default false).&lt;br /&gt;
*'''masked:''' covering up the text being typed for password text fields (default false).&lt;br /&gt;
*'''font:''' Name of font from folder &amp;quot;fonts&amp;quot; (default false, arial).&lt;br /&gt;
*'''activeColor:''' Color of line on the bottom when edit is active (default red).&lt;br /&gt;
*'''fontColor:''' Color of font (default white).&lt;br /&gt;
*'''backgroundColor:''' Color of editbox (default black).&lt;br /&gt;
*'''caretColor:''' Color of caret in text field (default white).&lt;br /&gt;
*'''visible:''' Visibility of editbox (default true).&lt;br /&gt;
*'''length:''' Max length for text field (default 40).&lt;br /&gt;
*'''font size:''' Available for DXFont (default scaled to edit size).&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns ID if element was successfully created, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function change visibility of editbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editSetVisible(element theElement, bool state)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change.&lt;br /&gt;
*'''state:''' true or false.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if successfully , false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function set mask to password fields&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editSetMasked(element theElement, bool mask)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to set mask.&lt;br /&gt;
*'''state:''' true of false.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if editbox will be masked, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function gets text from text field.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editGetText(element theElement)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element from where you want to get text.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns string text if successfully , false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function changes text into text field.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editSetText(element theElement, string text)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change text.&lt;br /&gt;
*'''text:''' New value.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if text set successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function changes max length od text field&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editMaxLength(element theElement, float length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change length.&lt;br /&gt;
*'''length:''' New value.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if length set successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function change 2D position on the screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editChangePos(element theElement, float x, float y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change position.&lt;br /&gt;
*'''x:''' 2D x position.&lt;br /&gt;
*'''y:''' 2D y position.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if succesfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function changes all properties of editbox&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool editSetProperty(element theElement, string properties, string value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change property.&lt;br /&gt;
*'''property:''' id,x,y,w,h,postgui,placeholder,masked,font,size,active,activecolor,bgcolor,caret,visible,cursor,maxLength,click,alpha,readOnly.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if properties set successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function destroy editbox&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool destroyCustomEdit(element theElement)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to destroy.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if destroy successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event trigger when you blur edit&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[player]] who blur edit.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example shows how to use &amp;quot;onCustomEditLeave&amp;quot;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onCustomEditLeave&amp;quot;,root,function(edit)&lt;br /&gt;
    print(&amp;quot;You leave edit &amp;quot;..edit)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event trigger when you blur edit&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[player]] who focus edit.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
This example shows how to use &amp;quot;onCustomEditFocus&amp;quot;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onCustomEditFocus&amp;quot;,root,function(edit)&lt;br /&gt;
    print(&amp;quot;You focus edit &amp;quot;..edit)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates editbox with some accessories.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local ce=exports.custom_edit&lt;br /&gt;
&lt;br /&gt;
local edit=ce:createCustomEdit(&amp;quot;&amp;quot;,500,500,300,70,false,&amp;quot;Password&amp;quot;,false,&amp;quot;font2&amp;quot;,{255,0,0,255},{255,255,255,255},{0,0,0,150},{255,255,255,255},true,false,false)&lt;br /&gt;
ce:editSetMasked(edit,true)&lt;br /&gt;
ce:editSetProperty(edit,&amp;quot;bgcolor&amp;quot;,{255,255,255,255})&lt;br /&gt;
ce:editChangePos(edit,700,700)&lt;br /&gt;
ce:editMaxLength(edit,50)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
guwniany kod^&lt;/div&gt;</summary>
		<author><name>Whitee</name></author>
	</entry>
</feed>