⚙️accessor
accessor
Last modified: 03 January 2025
This type represents a safe way to access maps.
__index
Returns an object by key.
Arguments
Name
Type
Description
key
string
Object key.
Returns
Type
Description
<type>
Object.
Example
local main_font = draw.fonts['gui_main'];
-- this also works
local main_font_2 = draw.fonts.gui_main;
__newindex
Sets an object by key.
Arguments
Name
Type
Description
key
string
Object key.
obj
<type>
Object.
Returns
Nothing.
Example
draw.fonts['my_font'] = my_font;
-- this also works
draw.fonts.my_font = my_font;
Last updated