Scripting, Code & Interaction: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 285: Line 285:
The basic idea of a pointer is that instead of creating a new variable in the memory, you are just going to "point" to one that is already stored there.  This can have several uses, and in AGS even has some special ones.
The basic idea of a pointer is that instead of creating a new variable in the memory, you are just going to "point" to one that is already stored there.  This can have several uses, and in AGS even has some special ones.


AGS has certain "managed" types that you can not create an instance (variable declaration) of.  All of the variables of managed types are "managed" by AGS.  These include the types:  Room, Game, Parser, File, InventoryItem, Overlay, DynamicSprite, GUI, Label, Button, Slider, TextBox, InvWindow, ListBox, Character, GUIControl, Hotspot, Region, Maths, DateTime, and Object.
AGS has certain ''managed'' types that you can not create an instance (variable declaration) of.  All of the variables of managed types are "managed" by AGS.  These include the types:  Room, Game, Parser, File, InventoryItem, Overlay, DynamicSprite, GUI, Label, Button, Slider, TextBox, InvWindow, ListBox, Character, GUIControl, Hotspot, Region, Maths, DateTime, and Object.


However, you can work with these managed types through pointers.  You define a pointer by typing the variable type, i.e. GUI, then a space, an asterik (*), and finally the name of the pointer.  So, to create a pointer named GUIPointer to point to the GUI object named gMygui, you could type:
However, you can work with these managed types through pointers.  You define a pointer by typing the variable type, i.e. GUI, then a space, an asterik (*), and finally the name of the pointer.  So, to create a pointer named GUIPointer to point to the GUI object named gMygui, you could type: