Difference between revisions of "Load.view"
(Created page with "The load.view and load.view.v commands load a view resource into memory. A view must be loaded before it can be assigned to any objects or used in...") |
|||
(14 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | The load.view | + | The '''load.view''' command loads a [[view]] resource onto the [[memory heap]]. |
− | + | == Syntax == | |
− | |||
− | load.view | + | load.view([[number|byt]] VIEWNUM); |
− | |||
− | + | == Remarks == | |
− | + | This command loads [[view]] '''VIEWNUM''' onto the [[memory heap]]. [[View]] resources must be loaded before being used in any other commands. If a view is not loaded before being used in commands, AGI will generate one of several [[trappable errors]]. [[View|Views]] should be unloaded using the '''[[discard.view]]''' or '''[[discard.view.v]]''' command once they are no longer needed. | |
− | + | AGI adds a script entry to the [[script stack]] each time a [[view]] resource is loaded. | |
− | + | == Possible Errors == | |
− | + | If you attempt to load a [[view]] that does not exist, AGI will raise a [[runtime error]] and crash. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Example == | == Example == | ||
− | + | <div class="CodeBlockHeader">Code:</div> | |
− | + | <syntaxhighlight lang="agi"> | |
− | < | + | [ typical code to assign a view to an object |
− | + | [ assume there is a view with ResourceID of 'Armor' | |
− | + | #define o1 Guard; | |
− | + | animate.obj(Guard); [ initialize the Guard object | |
− | + | load.view(Armour); [ load the view with the guard in armor | |
− | load.view | + | set.view(Guard, Armour); [ assign the view |
− | + | draw(Guard); [ and then draw the object on screen | |
− | + | </syntaxhighlight> | |
− | |||
− | |||
− | |||
− | == | + | == Technical Information == |
− | + | {| border="1" cellpadding="2" | |
+ | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' | ||
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 30 (0x1E hex) | ||
+ | |} | ||
− | + | == See Also == | |
− | [[ | + | [[Screen Object/View Commands]]<br /> |
− | [[Category: | + | '''[[load.view.v]]'''<br /> |
+ | [[Memory Management]]<br /> | ||
+ | [[AGI Scripts]]<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 21:16, 10 April 2019
The load.view command loads a view resource onto the memory heap.
Syntax
load.view(byt VIEWNUM);
Remarks
This command loads view VIEWNUM onto the memory heap. View resources must be loaded before being used in any other commands. If a view is not loaded before being used in commands, AGI will generate one of several trappable errors. Views should be unloaded using the discard.view or discard.view.v command once they are no longer needed.
AGI adds a script entry to the script stack each time a view resource is loaded.
Possible Errors
If you attempt to load a view that does not exist, AGI will raise a runtime error and crash.
Example
<syntaxhighlight lang="agi"> [ typical code to assign a view to an object [ assume there is a view with ResourceID of 'Armor'
- define o1 Guard;
animate.obj(Guard); [ initialize the Guard object load.view(Armour); [ load the view with the guard in armor set.view(Guard, Armour); [ assign the view draw(Guard); [ and then draw the object on screen </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 30 (0x1E hex) |
See Also
Screen Object/View Commands
load.view.v
Memory Management
AGI Scripts