Fixed CSV Parsing on tools
This commit is contained in:
@ -46,6 +46,8 @@ void TestUIScene::stage() {
|
||||
auto grid = this->canvas->addElement<UIGrid>();
|
||||
grid->setTransform(UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_STRETCH, glm::vec4(0, 0, 0, 0), 0);
|
||||
grid->setGridSize(4, 4, 8, 8);
|
||||
|
||||
auto menu = new UIMenu(this->canvas, grid->getColumns(), grid->getRows());
|
||||
|
||||
for(int32_t x = 0; x < grid->getColumns(); x++) {
|
||||
for(int32_t y = 0; y < grid->getRows(); y++) {
|
||||
@ -54,6 +56,15 @@ void TestUIScene::stage() {
|
||||
label->setText("test.1");
|
||||
label->setFontSize(24);
|
||||
grid->addToGrid(label, x, y, UI_COMPONENT_ALIGN_END, UI_COMPONENT_ALIGN_END);
|
||||
|
||||
auto menuItem = new TestMenuItem;
|
||||
menuItem->label = label;
|
||||
menu->setItem(x, y, menuItem);
|
||||
}
|
||||
|
||||
menu->setPosition(0, 0);
|
||||
this->canvas->setCurrentMenu(menu);
|
||||
}
|
||||
|
||||
this->canvas->setCurrentMenu(menu);
|
||||
}
|
@ -12,8 +12,33 @@
|
||||
#include "ui/UIGrid.hpp"
|
||||
#include "ui/UISprite.hpp"
|
||||
#include "prefabs/SimpleSpinningCubePrefab.hpp"
|
||||
#include "ui/UIMenu.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class TestMenuItem : public UIMenuItem {
|
||||
public:
|
||||
UILabel *label;
|
||||
void onItemSelected() {
|
||||
|
||||
}
|
||||
|
||||
void onItemOver() {
|
||||
this->label->setText("test.2");
|
||||
}
|
||||
|
||||
void onItemOff() {
|
||||
this->label->setText("test.1");
|
||||
}
|
||||
|
||||
bool_t canBeOvered() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool_t canBeSelected() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class TestUIScene : public Scene {
|
||||
private:
|
||||
Camera *camera = nullptr;
|
||||
|
Reference in New Issue
Block a user