-
Notifications
You must be signed in to change notification settings - Fork 9
TemplateVerbcoin
This template is a replacement for the previous VerbCoin template, with the aim of dropping legacy features and offering a simpler base to build upon.
The main changes are:
- There is no built-in mechanism for using timed clicks, so no press and hold of a mouse button is required anywhere
- Inventory is still right-click to open, but now BASS style controls are used within the inventory window
- No additional VerbCoin interfaces will be opened over the top of inventory items
- Rather than customize the action description per object/hotspot/character
and allow actions to change based on context, the emphasis is on fixed
actions with fallback to defaults (using
unhandled_event
)
As a general guide, left click on things to open the Verbcoin, right click to open the inventory window.
The script module functions are mostly to register the interface components used for displaying the VerbCoin and managing the inventory window.
Example:
// setup VerbCoin GUI and buttons
VerbCoin.InterfaceGui = gVerbCoin;
VerbCoin.RegisterButton(btnLook, eVerbCoinPositionNorth, eModeLookat, "Look at");
VerbCoin.RegisterButton(btnTalk, eVerbCoinPositionEast, eModeTalkto, "Talk to");
VerbCoin.RegisterButton(btnInteract, eVerbCoinPositionSouth, eModeInteract, "Use");
VerbCoin.RegisterButton(btnPickup, eVerbCoinPositionWest, eModePickup, "Pick up");
// select the inventory GUI and action label
VerbCoin.InventoryGui = gInventory;
VerbCoin.ActionLabel = lblAction;
// disable buttons where click events would be unhandled
VerbCoin.ButtonAutoDisable = true;
int VerbCoin.Radius
Sets the radius used when drawing the circle that renders the VerbCoin.
int VerbCoin.BackgroundTransparency
Sets the background transparency level (from 0 to 100) for the VerbCoin
int VerbCoin.BackgroundColor
Sets the background color (0 to 65535) for the VerbCoin.
int VerbCoin.BorderColor
Sets the border color (0 to 65535) for the VerbCoin
int VerbCoin.BorderWidth;
Sets the border width for the VerbCoin.
VerbCoin.OnClick(GUIControl* control, MouseButton button);
Since click handlers can currently only be implemented in the global script, this function is used to pass the event back into the VerbCoin module.
VerbCoin.RegisterButton(GUIControl* control, VerbCoinPosition position, CursorMode mode, String verbtext);
Registers a button for use with the VerbCoin. The design is currently 4-point, so valid positions are:
eVerbCoinPositionNorth
eVerbCoinPositionEast
eVerbCoinPositionSouth
eVerbCoinPositionWest
The cursor mode relates to the standard AGS cursor mode, which is used to determine the action performed. 'verbtext' is the text description of the action, e.g. if the mode being used is eModeInteract then a suitable description could be 'use'.
GUI* VerbCoin.InterfaceGui
Registers the GUI
used for the VerbCoin.
GUI* VerbCoin.InventoryGui
Registers the GUI
used for the inventory window.
Label* VerbCoin.ActionLabel
Registers the Label
used to display text descriptions.
VerbCoin.Enable();
Enables the VerbCoin interface.
VerbCoin.Disable();
Disables the VerbCoin interface.
VerbCoin.IsEnabled();
Returns true if the VerbCoin interface is currently enabled, else returns false.
VerbCoin.Open();
Opens the VerbCoin interface (i.e. show its GUI).
VerbCoin.Close();
Closes the VerbCoin interface (i.e. hide its GUI)
VerbCoin.IsOpen();
Returns true if the VerbCoin interface is currently open, else returns false.
VerbCoin.CleanUp();
Deletes the dynamic sprite which is used in rendering the VerbCoin user interface. This would typically only be done immediately before exiting the game, in-order to suppress warnings about dynamic sprites still being allocated.
bool VerbCoin.ButtonAutoDisable
Sets whether VerbCoin buttons should be disabled, if clicking them would result in an unhandled event.
See also: Templates, Setting up the game
Getting Started in AGS
Editor
- New Game templates
- Editor Preferences
- General Settings
- Default Setup
- Colours Editor
- Room Editor
- Character Editor
- Cursor Editor
- Dialog Editor
- Font Preview
- GUI Editor
- Inventory Items Editor
- View Editor
- Sprite Manager
- Music and sound
- Voice speech
- Script Modules
- System limits
- Log Panel
- Plugins
- Other Features
Engine
Scripting
- Scripting Tutorial
- Scripting Language
-
Scripting API
- Script API Overview
- Standard Constants
- Standard Enumerated Types
- Standard Types
- Game variables
- Global arrays
- Global event handlers
- repeatedly_execute / repeatedly_execute_always
- Custom dialog options rendering
- Global functions: general
- Global functions: message display
- Global functions: multimedia actions
- Global functions: palette operations
- Global functions: room actions
- Global functions: screen effects
- Global functions: wait
- AudioChannel functions and properties
- AudioClip functions and properties
- Camera functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- Dictionary functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game functions and properties
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Object functions and properties
- Overlay functions and properties
- Parser functions
- Region functions and properties
- Room functions and properties
- Screen functions and properties
- Set functions and properties
- Speech functions and properties
- String functions
- System functions and properties
- TextWindowGUI functions and properties
- ViewFrame functions and properties
- Viewport functions and properties
- Obsolete Script API
- Event Types
- Key code table
- Audio in script
Legal Notice
Getting in touch
Misc