TestGame build

This commit is contained in:
2025-06-09 20:11:03 -05:00
parent 410b52c6bb
commit aae8ff5c3f
6 changed files with 140 additions and 21 deletions

View File

@@ -10,7 +10,7 @@ JUI::Window* EditorApp::CreateAppInfoDialogWindow(JUI::Widget* parent)
{
// TODO: Implement JUI structure that makes blocks of text easy to impelement.
auto window = new JUI::Window(parent);
window->SetTitle("About Editor2D");
window->Title("About Editor2D");
window->Size({350_px, 375_px});
window->MinSize({350, 375});
@@ -21,9 +21,9 @@ JUI::Window* EditorApp::CreateAppInfoDialogWindow(JUI::Widget* parent)
auto line_item = [&] (const std::string& text, int size = 20, const Color4& color = Colors::White) {
auto* content = new JUI::TextRect(layout);
content->Size({100_percent, JUI::UDim(size+5, 0)});
content->SetContent(text);
content->SetTextSize(size);
content->SetTextColor(color);
content->Content(text);
content->TextSize(size);
content->TextColor(color);
content->BGColor(Colors::Transparent);
content->AlignCenterHorizontally();
content->BorderWidth(0);
@@ -60,9 +60,9 @@ JUI::Window* EditorApp::CreateAppInfoDialogWindow(JUI::Widget* parent)
auto btn_item = [&] (const std::string& text) -> JUI::TextButton* {
JUI::TextButton* btn = new JUI::TextButton(btn_layout);
btn->SetContent(text);
btn->Content(text);
btn->Size({32_percent, 100_percent});
btn->SetTextColor(Colors::Black);
btn->TextColor(Colors::Black);
btn->Center();
return btn;
};
@@ -233,7 +233,7 @@ JUI::Window* EditorApp::CreateTilesetViewerWindow(JUI::Widget* parent)
using namespace JUI;
auto* wind = new Window(parent);
wind->SetTitle("Tileset Viewer");
wind->Title("Tileset Viewer");
wind->Size(JUI::UDim2::FromPixels(loaded_tilesheet->GetDimensions().x, loaded_tilesheet->GetDimensions().y+20));
wind->SetResizable(false);
@@ -343,7 +343,7 @@ void EditorApp::CreateWidgets()
topbar = new JUI::UtilityBar(scene);
auto* file = topbar->AddSubmenu("File");
file->SetFont(JGL::Fonts::Jupiteroid);
file->Font(JGL::Fonts::Jupiteroid);
auto* new_map = file->AddButton("New Map", [this] () mutable {

View File

@@ -139,7 +139,7 @@ Vector2i Tileset::IndexToCell(int index) const
return {index % rows, index / rows};
}
int Tileset::CellToIndex(int cx, int cy)
int Tileset::CellToIndex(int cx, int cy) const
{
return cy*rows + cx;
}