-
Notifications
You must be signed in to change notification settings - Fork 0
TemplateBASS
This template is a modified version of what was previously known as the 'Lightweight BASS stub', although the script module within retains its previous name of TwoClickHandler. The behavior of the script module aims to simplify and mask the cursor modes, removing the need for the player to manually set them. It also implements default behaviors where none are explicitly implemented, through the use of unhandled_event in the global script.
Without making any direct comparisons which might result in a lawsuit, in the default mode left-clicking will do things, right-clicking will look at things. In the reversed mode, left-clicking will look at things, right-clicking will do things.
The popup threshold for the GUI is managed by two properties (PopupProportional and PopupDistance), both of which are considered at the same time. Setting both to 0 means that the GUI will never appear.
Example:
// register a GUI to use for the inventory bar
TwoClickHandler.InventoryGui = gInventoryBar;
// register a Label to use for action text
TwoClickHandler.ActionLabel = lblAction;
// select the reversed button mode (left-click to look, right-click to use)
TwoClickHandler.ReversedClicks = true;
// Set the popup threshold for the inventory bar
TwoClickHandler.PopupProportional = 0.5; // 50% of the GUI height or
TwoClickHandler.PopupDistance = 50; // 50 pixels
GUI* TwoClickHandler.InventoryGui
Assigns the GUI which will be used for the inventory.
Label* TwoClickHandler.ActionLabel
Assigns the Label which will be used to display text descriptions.
bool TwoClickHandler.ReversedClicks
Sets how left and right clicks are processed.
When true
: left-click to look, right-click to use
When false
: left-click to use, right-click to look
The default value is false
.
float TwoClickHandler.PopupProportional
Show and hide the inventory GUI when the mouse cursor y value is less than this proportion of the GUI height. For example, if the inventory GUI has a height of 100 pixels, a value of 0.9 will show the GUI when the mouse cursor distance to the top of the screen is less than 90 pixels.
The default value is 0.75
.
int TwoClickHandler.PopupDistance
Show and hide the inventory when the mouse cursor y value is less than this value.
The default value is 0
(effectively disabled in favor of PopupProportional).
TwoClickHandler.Close();
Hide the inventory GUI if it being shown. If the inventory GUI is already hidden then this function does nothing. This would typically only be called by higher level GUI management functions which require the inventory GUI to be replaced or suppressed.
Getting Started in AGS
Editor Reference
- Music and sound
- Distributing your game
- Backing up your game
- The text parser
- Translations
- Global variables
- Custom Properties
- Plugins
- Lip sync
- New Game templates
- Debugging features
- Auto-number speech files
- Integration with Windows
- Source Control integration
Engine
Scripting
- Scripting tutorial part 1
- Scripting tutorial part 2
- Pointers in AGS
- Calling global functions from local scripts
- The script header
- String formatting
- Multiple Scripts
- Understanding blocking scripts
- Dynamic Arrays
- Extender functions
- Game variables
- Predefined global script functions
- repeatedly_execute (_always)
- Custom dialog options rendering
- Built-in enumerated types
- Script language keywords
- AudioChannel functions and properties
- AudioClip functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game / Global functions
- 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
- Multimedia functions
- Object functions and properties
- Overlay functions and properties
- Palette functions
- Parser functions
- Region functions and properties
- Room functions
- Screen functions
- Speech functions and properties
- String functions
- System functions and properties
- Text display / Speech functions
- ViewFrame functions and properties
Working on Legacy games
Upgrading from a previous version
- Upgrading to AGS 2.7
- Upgrading to AGS 2.71
- Upgrading to AGS 3.0
- Upgrading to AGS 3.1
- Upgrading to AGS 3.2
- Upgrading to AGS 3.3
- Upgrading to AGS 3.3.5
- Upgrading to AGS 3.4
- Upgrading to AGS 3.4.1
Legal Notice
Getting in touch