-
Notifications
You must be signed in to change notification settings - Fork 10
Tumbleweed_translation
To make the verbs work with translations, strings are being used to define the button graphics, hotkeys and so on. If you like to customize your game or get it translated, you need to take a closer look at the function AdjustLanguage.
void Verbs.TranslateAction(int action, int tr_lang);
This function defines the text for the verb buttons, e.g. if you click on the talk verb button, "Talk to" is being displayed in the action/status bar. The second parameter defines the returned language. If you want to customize this text, you have to edit this function.
void Verbs.AdjustLanguage();
This function has to be called from inside the template's game_start() function. It sets up everything related to the verb buttons, so you need to take a look at this, if you want to customize your GUI. It is also import to understand, how this function works, if you want to get you game translated. If you take a closer look at this function, you will notice the following lines:
Verbs.SetActionButtons(eGA_Open, 0, 59, 60, 'q');
Verbs.SetActionButtons(eGA_Close, 1, 61, 62, 'a');
Verbs.SetActionButtons(eGA_GiveTo, 2, 63, 64, 'z');
and so on.
Your verb buttons are initialized here, by calling the function SetActionButtons. The parameters define the following:
- Defined Action/Verb
- GUI-button ID
- Spriteslot normal
- Sprite slot highlighted
- Keyboard-Shortcut.
This line
Verbs.SetActionButtons(eGA_GiveTo, 2, 63, 64, 'z');
tells the AGS:
- We want to define a button for the verb "Give"
- The buttons has the GUI-ID 2. If you take a look at the GUI "gMaingui", you can see several buttons. The one with the ID 2 will be used for the action you define here.
- The button will use the sprite-slot 63 as the default graphic and sprite-slot 64,
if it's highlighted.
This can be a little bit confusing, since if you look at
gMaingui
, those graphics have already been assigned. But you also need to define the graphics slots in this function, because eventually these are the ones being used. - The last parameter defines the hotkey for this action.
You might wonder, why this function overrides the values of gMaingui. But in some other languages the translation for use could be a very long word, so you might want to swap it with something else. E.g. in German "use" means "Benutze", so you need more space for the verb. But "pick up" can be translated to "nimm", so you save some space here.
Unlike the 9Verb MI-Style template, the fonts can be customized and overwritten in AdjustGUIText().
See also:
Verbs.SetActionButtons
void Verbs.AdjustGUIText();
This function will also be called inside the template's game_start() function. Here you can modify the labels of your GUI buttons for the options GUI. In case you need it, you can also define alternative fonts for different languages.
See also:
Verbs.AdjustLanguage
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
Hidden