Files
BlitzNext/_release/help/commands/2d_commands/Field.htm
T

65 lines
1.6 KiB
HTML
Raw Normal View History

2014-12-08 12:43:20 +13:00
<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>Field variable</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
variable = any legal variable
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
If you haven't read up on the TYPE command, you might want to do so before continuing.
<br />
<br />
When you define a custom Type, you need to assign some variables to track within in. Using the Field command within the Type .. End Type commands, you set a variable that can be used for EACH object created with the NEW command.
<br>
<br>
See also: <a class=small href=Type.htm>Type</a>, <a class=small href=End Type.htm>End Type</a>.
</td>
</tr>
</table>
<h1><a href=../2d_examples/Field.bb>Example</a></h1>
<table>
<tr>
<td>
; Define the CHAIR Type
<br />
<br />
Type CHAIR
<br />
Field X
<br />
Field Y
<br />
Field HEIGHT
<br />
End Type
<br />
<br />
; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
<br />
<br />
For tempx = 1 to 10
<br />
For tempy = 1 to 10
<br />
room.chair = New Chair
<br />
room\x = tempx
<br />
2014-02-26 16:08:39 +13:00
room\y = tempy