Difference between revisions of "Load.view"

From AGI Wiki
Jump to navigationJump to search
Line 9: Line 9:
 
The view <code>viewNumber</code> is loaded into memory.
 
The view <code>viewNumber</code> is loaded into memory.
  
== Parameters ==
+
== <br />Parameters ==
  
 
For <code>load.view</code>:
 
For <code>load.view</code>:
Line 19: Line 19:
 
* <code>viewNumber</code>: a [[variable]], v0-v255, whose value specifies the view that should be loaded  
 
* <code>viewNumber</code>: a [[variable]], v0-v255, whose value specifies the view that should be loaded  
  
 +
&nbsp;
 
== Possible errors ==
 
== Possible errors ==
  
Line 25: Line 26:
 
* If the view resource is already loaded, it is not loaded a second time, nor is the [[Script Buffer|script buffer]] affected. If the view is [[discard.view|discarded]] and then loaded again, it will of course be loaded a second time; however, this adds to the [[Script Buffer|script buffer]].
 
* If the view resource is already loaded, it is not loaded a second time, nor is the [[Script Buffer|script buffer]] affected. If the view is [[discard.view|discarded]] and then loaded again, it will of course be loaded a second time; however, this adds to the [[Script Buffer|script buffer]].
  
 +
&nbsp;
 
== Example ==
 
== Example ==
  
Line 36: Line 38:
 
load.view.v(v195);</code>
 
load.view.v(v195);</code>
  
 +
&nbsp;
 
== See also ==
 
== See also ==
  
Line 41: Line 44:
 
* [[set.view ]]
 
* [[set.view ]]
  
 +
&nbsp;
 
== Sources ==
 
== Sources ==
  

Revision as of 16:20, 28 December 2013

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 any command such as add.to.pic (note: a view does not have to be loaded before the show.obj command is used).

load.view(number viewNumber);

load.view.v(variable viewNumber);

The view viewNumber is loaded into memory.


Parameters

For load.view:

  • viewNumber: a number, 0-255, specifying the view that should be loaded

For the indirect version, load.view.v:

  • viewNumber: a variable, v0-v255, whose value specifies the view that should be loaded

 

Possible errors

  • The view must exist in the game's vol files, or the game will crash with a view not found error.
  • There must be sufficient memory to load the entire view resource into memory, or the game will crash with an out of memory error.
  • If the view resource is already loaded, it is not loaded a second time, nor is the script buffer affected. If the view is discarded and then loaded again, it will of course be loaded a second time; however, this adds to the script buffer.

 

Example

The following code loads VIEW.025 into memory using load.view:

load.view(25);

The following code uses the indirect command load.view.v to do the same thing:

v195 = 25; load.view.v(v195);

 

See also

 

Sources

Some of the text in this article is taken from the AGI Studio help file.