ScrollablePanel 0.8 arrow texture
« on: 02 September 2018, 16:54:27 »
Hi, please tell me how to change the texture ScrollablePanel arrow
My ScrollablePanel in txt:
Quote
ScrollablePanel."MyScrollablePanel" {
    ContentSize = (0, 0);
    Position = (0, parent.height - 528);
    Size = (280, 448);

    Renderer {
        BackgroundColor = Transparent;
    }
}

*

texus

  • *****
  • 1254
    • View Profile
    • Texus's Blog
Re: ScrollablePanel 0.8 arrow texture
« Reply #1 on: 02 September 2018, 18:43:38 »
Inside the Renderer section you can add a "Scrollbar" section where the renderer properties for the scrollbar are placed.

It should look like this:
ScrollablePanel {
    ContentSize = (0, 0);
    Size = (&.size, &.size);

    Renderer {
        backgroundcolor = white;
        bordercolor = black;
   
        scrollbar {
            texturearrowdown = "TGUI/themes/Black.png" Part(163, 174, 20, 20) Middle(0, 1, 20, 19);
            texturearrowdownhover = "TGUI/themes/Black.png" Part(183, 174, 20, 20) Middle(0, 1, 20, 19);
            texturearrowup = "TGUI/themes/Black.png" Part(163, 154, 20, 20) Middle(0, 0, 20, 19);
            texturearrowuphover = "TGUI/themes/Black.png" Part(183, 154, 20, 20) Middle(0, 0, 20, 19);
            texturethumb = "TGUI/themes/Black.png" Part(143, 154, 20, 20);
            texturethumbhover = "TGUI/themes/Black.png" Part(143, 174, 20, 20);
            texturetrack = "TGUI/themes/Black.png" Part(123, 154, 20, 20);
            texturetrackhover = "TGUI/themes/Black.png" Part(123, 174, 20, 20);
        }
    }
}

I generated the above by just running the following:
auto panel = tgui::ScrollablePanel::create();
tgui::Theme theme("TGUI/themes/Black.txt");
panel->getRenderer()->setScrollbar(theme.getRenderer("Scrollbar"));
gui.add(panel);
gui.saveWidgetsToFile("temp.txt");