-
Notifications
You must be signed in to change notification settings - Fork 9
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.
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