Difference between revisions of "Template:Usage"
From Spherical
m (Cleanup) |
(split out doc) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly><div class="sph-usage">{{#if: {{{returns|}}} | ''{{{returns}}}'' | + | <includeonly><div class="sph-usage">{{#if: {{{returns|}}} | ''{{{returns}}}''   | }}{{#if: {{{object|}}} | [[API:{{{object}}}|{{{object}}}]]. | }}'''{{{func}}}'''({{#if: {{{params|}}} | ''{{{params}}}'' | }});</div></includeonly> |
− | <noinclude | + | <noinclude>{{Usage/doc}}</noinclude> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </noinclude> |
Latest revision as of 00:18, 9 June 2013
Usage
{{usage|[returns=returntype|][object=objecttype|]func=functionname[|params=parameters]}}
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; try to be exact, as this will also link to that object's article
- 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);