7 using namespace bl::gui;
11 window = Window::create(LinePacker::create(LinePacker::Vertical, 4.f),
"Render Map");
12 window->getSignal(Event::Closed).willAlwaysCall(std::bind(&RenderMapWindow::close,
this));
14 window->pack(Label::create(
"Render the map to an image file"));
16 charBut = CheckButton::create(
"Render characters");
17 window->pack(charBut);
19 window->pack(lightSelect);
21 Box::Ptr row = Box::create(LinePacker::create(LinePacker::Horizontal, 4.f));
22 Button::Ptr renderBut = Button::create(
"Render");
23 renderBut->getSignal(Event::LeftClicked)
24 .willAlwaysCall(std::bind(&RenderMapWindow::start,
this));
26 Button::Ptr closeBut = Button::create(
"Cancel");
27 closeBut->getSignal(Event::LeftClicked)
28 .willAlwaysCall(std::bind(&RenderMapWindow::close,
this));
34 window->setForceFocus(
true);
35 lightSelect->setLightLevel(255);
44 void RenderMapWindow::close() {
45 window->setForceFocus(
false);
49 void RenderMapWindow::start() {
50 const char* filters[] = {
"*.png"};
52 bl::dialog::tinyfd_saveFileDialog(
"Save Map Rendering",
"", 1, filters,
"PNG files");
All classes and functionality used for implementing the game editor.
static Ptr create(const std::string &prompt, const ChangeCb &onChange)
Create a new light level slider.
std::function< void()> StartRender
Callback for when the render should trigger.
bool renderCharacters() const
Returns whether or not to render the characters in the map.
const std::string & outputPath() const
Returns the filename to output to.
void open(bl::gui::GUI *gui)
Opens the window.
std::uint8_t lightLevel() const
Returns the light level to render the map at.
RenderMapWindow(const StartRender &onStart)
Construct a new Render Map Window.