Replies: 5 comments
-
Is there any chance to have something like a Gui Filler ? In previous version was added. Thanks for answer. |
Beta Was this translation helpful? Give feedback.
-
Had taken a break from the project as I was busy with other stuff but back to it now. I had a few issues with the previous filler, most important was that it didn't allow much customization. You had what was built-in and that's it. So to do this a bit differently I've decided to use the concept of Here is my current proposal: component.render((container) -> {
container.fill(new BorderGuiLayout(6), ItemBuilder.from(Material.POTATO).asGuiItem());
}); This being a simple border layout, items will be filled in a border. I can add quite a few built-in to re-create the previous filler. |
Beta Was this translation helpful? Give feedback.
-
New way to update the title of a GUI by simply associating a state to it. final var clicks = MutableState.of(0);
final Gui gui = Gui.of(6)
.title(title -> {
title.state(clicks);
title.render(() -> Component.text("Title -> " + clicks.getValue()));
})
.component(component -> {
component.state(clicks);
component.render(container -> {
container.set(Slot.of(1, 1), ItemBuilder.from(Material.POTATO).asGuiItem((player, context) -> {
player.sendMessage(Component.text("State -> " + clicks.getValue()));
clicks.setValue(clicks.getValue() + 1);
}));
});
})
.build(); On this example every time you click on the potato it'll change the number in the title. |
Beta Was this translation helpful? Give feedback.
-
Also added a simpler method for static items, instead of having to do the whole thing when creating a component with the render method, etc. .statelessComponent(container -> {
container.fill(new BorderGuiLayout(6), ItemBuilder.from(Material.POTATO).asGuiItem());
}) Perfect for filling or just decoration items that will never need to change. |
Beta Was this translation helpful? Give feedback.
-
I might change naming of things a bit, still not too sure, but was thinking basing it more on Compose. Using words like |
Beta Was this translation helpful? Give feedback.
-
Discussion for everything related to #113.
Feature requests, questions, ideas, etc.
Try it out
This is very early developments so many features are missing and many bugs might be present, use only for testing purposes.
Beta Was this translation helpful? Give feedback.
All reactions