Skip to content

Settings Builder

Each effect can define settings via the layer settings builder by overriding the GenerateSettings(...) method (see example below). The settings builder implements the following interface.

The settings builder implements the following interface.

public interface ISettingsBuilder
{
    /// <summary>
    /// Starts a new settings page with the given title.
    /// </summary>
    /// <param name="pageTitle">Title of the new settings page</param>
    void PageBegin(string pageTitle);

    /// <summary>
    /// Starts a new settings page without title.
    /// </summary>
    void PageBegin();

    /// <summary>
    /// Ends the previously started settings page. 
    /// </summary>
    void PageEnd();

    /// <summary>
    /// Starts a new settings group on a previously started settings page. 
    /// </summary>
    /// <param name="groupName">Name for the new settings group</param>
    void GroupBegin(string groupName);

    /// <summary>
    /// Ends the previously started settings group.
    /// </summary>
    void GroupEnd();

    /// <summary>
    /// Adds a predefined settings group for a color value on a previously started settings page. 
    /// </summary>
    /// <param name="color">Default color</param>
    /// <param name="settingId">Custom setting id</param>
    /// <param name="groupName">Name for this settings group</param>
    void AddColorGroup(SKColor color, uint settingId, string groupName = "Color");

    /// <summary>
    /// Adds a slider setting on a previously started settings group. 
    /// </summary>
    /// <param name="value">Default value</param>
    /// <param name="min">Minimum value</param>
    /// <param name="max">Maximum value</param>
    /// <param name="settingId">Custom setting id</param>
    void AddSlider(float value, float min, float max, uint settingId);

    /// <summary>
    /// Adds a bindable slider setting on a previously started settings group. 
    /// </summary>
    /// <param name="value">Default value</param>
    /// <param name="min">Minimum value</param>
    /// <param name="max">Maximum value</param>
    /// <param name="settingId">Custom setting id</param>
    void AddBindableSlider(float value, float min, float max, uint settingId);

    /// <summary>
    /// Adds a bindable trigger setting on a previously started settings group. 
    /// </summary>
    /// <param name="triggerId">Custom trigger id</param>
    void AddBindableTrigger(uint triggerId);
}

Read more: