-
[1.15] Create a Button Subclass
I'm just asking for some tips what should I do, and for making topics i will stick to one from nowon
- [1.15] Create a Button Subclass
-
[1.15] Create a Button Subclass
Hello, I need help with creating a button subclass, and overriding the relevant method(s). I want to change color of a button, also onHover. I've been told I cant do this with the default Button. Any help would be appreciated, thanks in forward.
-
[1.15] Changing Color of Button
Oh, that makes sense now, thank you
-
[1.15] Changing Color of Button
Hello, I was wondering if it is possible to change a color of a button added with addWidget method? Also if its possible to change color onHover? event.addWidget(new Button(154, 33, 31, 14, "", new CustomAction())); Thanks!
-
[1.15] Issues With Button
Its working after changing from .Pre to .Post, thank you very much for your time!
-
[1.15] Issues With Button
So basically instead of .Pre i would use .Post
-
[1.15] Issues With Button
Sorry, but i dont understand
-
[1.15] Issues With Button
Isnt the event called with event handler?
-
[1.15] Issues With Button
Once again, I've been told on discord that event is called with event handler.
-
[1.15] Issues With Button
Sure, This is the code after I removed Bus.MOD and changed x,y,height,width of button @Mod.EventBusSubscriber(modid = StudyingMod.MOD_ID, bus = Bus.FORGE, value = Dist.CLIENT) public class SurvivalInventory { @SubscribeEvent public static void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(154, 33, 31, 14, "test", new CustomAction())); } } public static class CustomAction implements IPressable { public void onPress(Button button) { } } }
-
[1.15] Issues With Button
Again, it's not working for some reason. I tried changing x, y of the button but didn't help. At this point i really don't know what to do
-
[1.15] Issues With Button
Should i remove it completely?
-
[1.15] Issues With Button
Hello there, I added a addWidget method to instance of InventoryScreen but it seems not to work. I don't know what might be causing the issue. Perhaps its my event handler. @Mod.EventBusSubscriber(modid = StudyingMod.MOD_ID, bus = Bus.MOD, value = Dist.CLIENT) public class SurvivalInventory { @SubscribeEvent public static void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(8, 12, 6, 3, "test", new CustomAction())); } } public static class CustomAction implements IPressable { public void onPress(Button button) { } } } If anyone knows what the issue might be, help would be really appreciated. Thanks in forward!
-
[1.15] Adding a Button to a player inventory
I have my event handler, but anyways doesn't seem to be working. Well I will work something out. thank you for your time!
IPS spam blocked by CleanTalk.