Template:API member: Difference between revisions

From TeamSpec Wiki
Jump to navigation Jump to search
Template: scripting reference member block
 
TeamSpec theme: colours move from inline styles to MediaWiki:Common.css classes
 
Line 1: Line 1:
<includeonly><div style="border:1px solid #c8ccd1;border-left:4px solid #36c;background:#f8f9fa;color:#202122;padding:8px 12px;margin:6px 0 14px 0;border-radius:2px;"><div style="font-family:monospace;font-size:1.05em;background:#eaecf0;padding:4px 8px;margin-bottom:6px;border-radius:2px;overflow-x:auto;white-space:pre-wrap;">{{{signature|{{{name|}}}}}}</div><div style="font-size:0.9em;color:#54595d;margin-bottom:6px;">'''{{{kind|Member}}}'''{{#if:{{{scripts|}}}|&nbsp;&middot; Available to {{{scripts}}}}}</div>
<includeonly><div class="ts-api"><div class="ts-api-signature">{{{signature|{{{name|}}}}}}</div><div class="ts-api-kind">'''{{{kind|Member}}}'''{{#if:{{{scripts|}}}|&nbsp;&middot; Available to {{{scripts}}}}}</div>
{{{description|}}}
{{{description|}}}
{{#if:{{{params|}}}|<div style="margin-top:6px;">'''Parameters'''</div>
{{#if:{{{params|}}}|<div style="margin-top:6px;">'''Parameters'''</div>

Latest revision as of 08:01, 20 October 2026

One member of a gamemode scripting class: its signature, what it does, its parameters and what it returns. Put the member's own heading (its exact name) just above it, so links can point at Page#member_name.

Usage

=== respawn_in ===
{{API member
|name=respawn_in
|kind=Method
|signature=respawn_in(entity_id: int, seconds: float) -> void
|scripts=<code>server.gd</code>, <code>bot.gd</code>
|params=* <code>entity_id</code>: <code>int</code>
* <code>seconds</code>: <code>float</code>
|returns=<code>void</code>
|description=Brings the player back after the given time.
}}

Parameters

  • name: the member's name.
  • kind: Method, Hook, Property or Constant.
  • signature: the full signature, shown in code style. Write &#124; for a pipe.
  • scripts: which scripts may use it (optional).
  • params: a bullet list of parameters (optional).
  • returns: the return type (optional).
  • description: what it does.