YoYo Games Wiki

Template:GMfunc

From YoYoGames Wiki

Template Documentation

This is a template documentation page which documents the possible uses of a template on the YoYo Games wiki.

The GMfunc Template

The {{GMfunc}} template is used in Game Maker Function Articles.

General Format

The template is inserted at the absolute beginning of the article as can be seen:


{{GMfunc|
title=
|description=
|arguments=
|return=
|image=
}}

Arguments

Not all of the arguments included above need to be written and defined.

title

A required field. This includes the full name of the function, along with its variables. For example, for surface_getpixel, the name would be "surface_getpixel(id,x,y)". The title will edit the name of the article appearing in the header and the browser's titlebar.

description

An optional but very recommended field to use. Includes a short description of the function and what it does. If there is any further explanation of the function, this shouldn't belong to the description nor any part of the template, but instead is inserted after the template as described in YY:FUNC.

arguments

Arguments are optional and are only written when they exist for a given function. They are written in a bullet-style. The general format of a single argument is as follows:

  • name (string/real): description of the argument.

For example, the make_color_rgb function has the following arguments:


|arguments=*'''red''' ([[real]]): The amount of red to use, integer from 0-255
*'''green''' ([[real]]): The amount of green to use, integer from 0-255
*'''blue''' ([[real]]): The amount of blue to use, integer from 0-255

return

The return is an optional variable in the template and is only written when it applies. Since only one value is returned, it is not in bullet style. A return value is written as follows: (string/real): description of the returned value.

For example, the abs function has the following written as its return value:


|return=([[real]]): absolute value of x

image

An absolute optional link to an image that might describe some information about a given function.

Uses

The GMfunc template should be used in game maker function articles. For more information about formatting Game Maker function articles in general, see Project:Article Formatting/Functions.

Dependencies