Adds an option to the "Settings" charm based on an external XAML file for the Windows 8 Native target module.


GML Code Example

win8_settingscharm_add_xaml_entry(name, xamlPath, headerRGB, callback, wide);

Argument Description
name The name of the option to add to the charm.
xamlPath Full path to the XAML file to use
headerRGB The header colour of the flyout as a hex string, with the format "#RRGGBB".
callback The script to run if pressed.
wide Set to true for a wide fly-out or false otherwise.

Returns: String


This function is similar to the win8_settingscharm_add_entry only this time you can define your own slide-out menu and options from an external XAML formatted file.

You can then give your new options a name (a string) to show on the fly-out, then you need to add in the path to get to the XAML file (this should be included in the game package as an Included File). You can also define the header colour of the fly-out as hex value #RRGGBB (for example, #ff40a0) and give a script to be called when the setting has been selected. This script must take the following arguments:

  • argument0: The element name, a string, which should be the same as that specified as the name in the XAML file.
  • argument1: The element type, a string, which can be one of the following:

    • "TextBox - TextChanged event, and the returned data is text content
    • "Button" - Click event with no data returned
    • "ToggleSwitch" - Toggled event, where the returned string is either "True" or "False"
    • "RadioButton" - Checked event, where the returned string data is either "True" or "False"
  • argument2: The returned value for the named element, as a string (see above for details).

The function itself will return the string "OK" if it has successfully added the XAML to the Settings Charm, otherwise it will return a string with the error details. You can find an example of how the XAML should be formatted from the YoYo Games Knowledge Base article HTML and XAML Examples For The Windows 8 Settings Charm.

NOTE: This function is for the Windows 8 Native target module only. For Windows 8 JavaScript support, please see win8_settingscharm_add_html_entry.


GML Code Example

var result = win8_settingscharm_add_xaml_entry("Settings", "xaml2.txt", "#ff20a0", scr_SettingsCallback, false);

The above code will create a new option within the Settings Charm, taken from the given file, and associate it with the script "scr_SettingsCallback".

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here