Skip to content

feature/bug ❓ : Only last textbox is interactive; all share the same input #70

@JQTPeng

Description

@JQTPeng

Image
Image
Image

Using Headers

Works with headers only if one header is open. If two or more headers are open, each textbox will sync with one input.
Image

Code

// Renderer
public static void Run()
{
    Window window = SplashKit.OpenWindow(WIN_NAME, WIN_WIDTH, WIN_HEIGHT);
    while (!SplashKit.WindowCloseRequested(WIN_NAME))
    {
        SplashKit.ProcessEvents();
        SplashKit.ClearScreen();

        SplashKit.DrawRectangleOnWindow(window, Color.Black, VIEW_X, VIEW_Y, VIEW_WIDTH, VIEW_HEIGHT);
        CurrentView.DrawPanel();

        RangeX = SplashKit.TextBox("rangeX", RangeX);
        RangeY = SplashKit.TextBox("rangeY", RangeY);
        SplashKit.SetInterfaceSpacing(10, 8);
        SplashKit.DrawInterface();
        SplashKit.RefreshScreen();
    }
    window.Close();
}
// Interface to render
public int string RangeX { get; set; }
public int string RangeY { get; set; }
public void DrawPanel()
{
    if (!SplashKit.StartPanel(CONFIG_NAME, new() { X = CONFIG_X, Y = CONFIG_Y, Width = CONFIG_WIDTH, Height = CONFIG_HEIGHT })) return;
    SplashKit.LabelElement("Playback--------------------");
    SplashKit.LabelElement("Map Settings----------------");
    RangeX = SplashKit.TextBox("rangeX", RangeX);
    RangeY = SplashKit.TextBox("rangeY", RangeY);
    Speed = SplashKit.Slider("Speed", Speed, 0, 10);
    SplashKit.SetInterfacePanelShadows(10, Color.Black, shadow_Offset);
    SplashKit.EndPanel(CONFIG_NAME);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions