36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<title>Variables</title>
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body background="images/back.gif">
|
|
<!--START-->
|
|
|
|
<h3>Variables</h3>
|
|
|
|
Like any programming language GML contains variables. Variables are memory
|
|
locations that store information. They have a name so that you can refer
|
|
to them. A variable in GML can store either a real number or a string.
|
|
Variables do not need to be declared like in many other languages. There
|
|
are a large number of built-in variables. Some are general, like
|
|
<tt>mouse_x</tt> and <tt>mouse_y</tt> that indicate the current mouse
|
|
position, while all others are local to the object instance for which we
|
|
execute the program, like x and y that indicate the current position of
|
|
the instance. A variable has a name that must start with a letter and can
|
|
contain only letters, numbers, and the underscore symbol '_'. (The maximal
|
|
length is 64 symbols.) When you use a new variable it is local to the
|
|
current instance and is not known in programs for other instances (even of
|
|
the same object). You can though refer to variables in other instances;
|
|
see below.
|
|
|
|
<!--END-->
|
|
</body>
|
|
</html>
|
|
|
|
<!-- KEYWORDS
|
|
variables
|
|
variable name
|
|
local variables
|
|
--> |