Template:DGS/OOP: Difference between revisions
Jump to navigation
Jump to search
(DGS OOP Syntax Mission) |
m (little correction) |
||
Line 3: | Line 3: | ||
</includeonly><noinclude>{{Template documentation|Template for OOP (object orientated programming)| | </includeonly><noinclude>{{Template documentation|Template for OOP (object orientated programming)| | ||
==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">Syntax</span>== | ==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">Syntax</span>== | ||
<syntaxhighlight lang="lua">{{OOP|NOTE|METHOD|EVENT|VARIABLE|COUNTERPART|ELEMENT_TYPE|ELEMENT_NAME}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP|NOTE|METHOD|EVENT|VARIABLE|COUNTERPART|ELEMENT_TYPE|ELEMENT_NAME}}</syntaxhighlight> | ||
==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">For functions</span>== | ==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">For functions</span>== | ||
{{OOP|This function creates a 3d interface in the world.|dgs3DInterface||}} | {{DGS/OOP|This function creates a 3d interface in the world.|dgs3DInterface||}} | ||
<syntaxhighlight lang="lua">{{OOP|This function creates a 3d interface in the world.|dgs3DInterface||}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP|This function creates a 3d interface in the world.|dgs3DInterface||}}</syntaxhighlight> | ||
{{OOP||DGSElement:setText||text|dgsGetText}} | {{DGS/OOP||DGSElement:setText||text|dgsGetText}} | ||
<syntaxhighlight lang="lua">{{OOP||DGSElement:setText||text|dgsGetText}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP||DGSElement:setText||text|dgsGetText}}</syntaxhighlight> | ||
{{OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|DGSGridList}} | {{DGS/OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|DGSGridList}} | ||
<syntaxhighlight lang="lua">{{OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|GridList}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|GridList}}</syntaxhighlight> | ||
==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">For events</span>== | ==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">For events</span>== | ||
{{OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}} | {{DGS/OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}} | ||
<syntaxhighlight lang="lua">{{OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}}</syntaxhighlight> | ||
{{OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}} | {{DGS/OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}} | ||
<syntaxhighlight lang="lua">{{OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}}</syntaxhighlight> | <syntaxhighlight lang="lua">{{DGS/OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}}</syntaxhighlight> | ||
Hey guys, here are a few "rules" in using the OOP template: | Hey guys, here are a few "rules" in using the OOP template: |
Revision as of 20:13, 15 April 2021
Template Documentation
Template for OOP (object orientated programming)
Usage
Syntax
{{DGS/OOP|NOTE|METHOD|EVENT|VARIABLE|COUNTERPART|ELEMENT_TYPE|ELEMENT_NAME}}
For functions
DGS OOP Syntax Help! I don't understand this!
- Note: This function creates a 3d interface in the world.
- Method: dgs3DInterface(...)
{{DGS/OOP|This function creates a 3d interface in the world.|dgs3DInterface||}}
DGS OOP Syntax Help! I don't understand this!
- Method: DGSElement:setText(...)
- Variable: .text
- Counterpart: dgsGetText
{{DGS/OOP||DGSElement:setText||text|dgsGetText}}
DGS OOP Syntax Help! I don't understand this!
- Note: This function is used to create columns in grid lists.
- Method: DGSGridList : addColumn(...)
- Counterpart: dgsGridListRemoveColumn
{{DGS/OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|GridList}}
For events
DGS OOP Syntax Help! I don't understand this!
- Note: This event is triggered each time a DGS element gains input focus
- Event: DGSElement : on("dgsFocus", ...)
{{DGS/OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}}
DGS OOP Syntax Help! I don't understand this!
- Note: This event is triggered when enter is pressed on a dgs edit box.
- Event: DGSEditBox : on("dgsEditAccepted", ...)
{{DGS/OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}}
Hey guys, here are a few "rules" in using the OOP template:
- If it's a constructor, such as createPed, use "Ped" not "createPed" or "Ped.create"
- If it's a static class function or a constructor, use a capital letter for the first character. (Player not player).
- Likewise, if it's an object function such as "player:setName", use lowercase.
- Use full stops (or if you're american, "periods.") for static functions and colons (:) for object functions.