Difference between revisions of "Template:Usage"
From Spherical
(Added 'return') |
(Doc) |
||
Line 1: | Line 1: | ||
− | <includeonly><div class="sph-usage">{{# | + | <includeonly><div class="sph-usage">{{#if: {{{returns|}}} | '''{{{returns}}} ''' | }}{{#if: {{{object|}}} | [[API:{{{object}}}|{{{object}}}]]. | }}'''{{{func}}}'''(''{{{params|}}}'');</div></includeonly> |
<noinclude>Use this template to demonstrate Sphere API. Template parameters include: | <noinclude>Use this template to demonstrate Sphere API. Template parameters include: | ||
− | * ''' | + | * '''returns''' ''(optional)'' - The return type of the function |
* '''object''' ''(optional)'' - The Sphere object this function is a member of, if any | * '''object''' ''(optional)'' - The Sphere object this function is a member of, if any | ||
* '''func''' - The name of the function | * '''func''' - The name of the function | ||
Line 11: | Line 11: | ||
{{Usage|object=sound|func=play|params=repeat}} | {{Usage|object=sound|func=play|params=repeat}} | ||
+ | |||
+ | And <tt><nowiki>{{Usage|returns=WindowStyle|func=LoadWindowStyle|params=filename}}</nowiki></tt> will result in: | ||
+ | |||
+ | {{Usage|returns=WindowStyle|func=LoadWindowStyle|params=filename}} | ||
</noinclude> | </noinclude> |
Revision as of 19:25, 20 May 2013
Use this template to demonstrate Sphere API. Template parameters include:
- returns (optional) - The return type of the function
- object (optional) - The Sphere object this function is a member of, if any
- func - The name of the function
- params (optional) - A comma-separated list of function parameters, if any
For example, {{Usage|object=sound|func=play|params=repeat}} will result in:
sound.play(repeat);
And {{Usage|returns=WindowStyle|func=LoadWindowStyle|params=filename}} will result in:
WindowStyle LoadWindowStyle(filename);