Scripting, Code & Interaction: Difference between revisions

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:  [http://www.bigbluecup.com/manual/Room%20_%20Screen%20functions.htm Room], [http://www.bigbluecup.com/manual/Game%20_%20Global%20functions.htm Game], [http://www.bigbluecup.com/manual/Parser%20functions.htm Parser], [http://www.bigbluecup.com/manual/File%20functions%20and%20properties.htm 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:  [http://www.bigbluecup.com/manual/Room%20_%20Screen%20functions.htm Room], [http://www.bigbluecup.com/manual/Game%20_%20Global%20functions.htm Game], [http://www.bigbluecup.com/manual/Parser%20functions.htm Parser], [http://www.bigbluecup.com/manual/File%20functions%20and%20properties.htm File], [http://www.bigbluecup.com/manual/Inventory%20item%20functions%20and%20properties.htm InventoryItem], [http://www.bigbluecup.com/manual/Overlay%20functions%20and%20properties.htm Overlay], [http://www.bigbluecup.com/manual/DynamicSprite%20functions%20and%20properties.htm DynamicSprite], [http://www.bigbluecup.com/manual/GUIFuncsAndProps.htm GUI], [http://www.bigbluecup.com/manual/GUI%20Label%20functions%20and%20properties.htm Label], [http://www.bigbluecup.com/manual/GUI%20Button%20functions%20and%20properties.htm Button], [http://www.bigbluecup.com/manual/GUI%20Slider%20properties.htm Slider], [http://www.bigbluecup.com/manual/GUI%20Text%20Box%20functions%20and%20properties.htm TextBox], [http://www.bigbluecup.com/manual/GUIInvFuncs.htm InvWindow], [http://www.bigbluecup.com/manual/GUI%20List%20Box%20functions%20and%20properties.htm ListBox], [http://www.bigbluecup.com/manual/Character%20functions%20and%20properties.htm Character], [http://www.bigbluecup.com/manual/GUI%20control%20functions%20and%20properties.htm GUIControl], [http://www.bigbluecup.com/manual/Hotspot%20functions%20and%20properties.htm Hotspot], [http://www.bigbluecup.com/manual/Region%20functions%20and%20properties.htm Region], [http://www.bigbluecup.com/manual/Maths%20functions%20and%20properties.htm Maths], [http://www.bigbluecup.com/manual/DateTime%20functions%20and%20properties.htm DateTime], and [http://www.bigbluecup.com/manual/Object%20functions%20and%20properties.htm 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:
Anonymous user