Skip to main content
11 events
when toggle format what by license comment
Nov 29, 2017 at 20:38 comment added Kerdo Still two questions: 1) How do I make sliders? How do I make them follow the mouse? I have to set the selection point of the bounds and move it by how much the mouse moves or something? 2) When holding mouse1 (in game) and moving the mouse at the same time the mouse x and y still update but I'm drawing a line from the player to the mouse x and y, the line stays still and so do the bullets.
Nov 29, 2017 at 20:35 comment added Kerdo So I got it working like it should. Added a line in MenuManager's setmenu function that sets the currently selected UI Manager (that the MouseManager uses to send over mousepresses) to the selected menu's ones.
Nov 29, 2017 at 20:16 comment added Kerdo I'm only using pure Java. Here's my drawing code in my main gameloop: imgur.com/r2SgDxz
Nov 29, 2017 at 13:19 comment added ice1000 Can I see your drawing code? Maybe your way of drawing the widgets is wrong. You may ask a new question and send me the link, since it's a different topic
Nov 29, 2017 at 13:17 comment added ice1000 Actually I'm not familiar with the API you used so I can't be helpful with the usage of the widgets :) (BTW you have 16 rep now and you can upvote my answer :)
Nov 29, 2017 at 13:16 history edited ice1000 CC BY-SA 3.0
deleted 5 characters in body
Nov 29, 2017 at 13:14 comment added ice1000 A suggestion: for (A a : as) { if (!a.x()) continue; a.y(); } can be replaced with for (A a : as) { if (a.x()) a.y(); } :D
Nov 29, 2017 at 13:06 comment added ice1000 You can g.fillRect(0, 0, width, height) before every refresh
Nov 28, 2017 at 17:19 comment added Kerdo Some screencaps of my code: imgur.com/XRWA1XB (MouseManager), imgur.com/a/YsHXt (Main menu UI implementation), imgur.com/a/qQDWm (UIManager). Any comments of making it better? (2/2)
Nov 28, 2017 at 17:17 comment added Kerdo Thanks for your reply. I followed some tutorials and now got some things still to ask: I'm switching between gamestates (main menu, pause menu, etc). When switching the old menu's ui components are still accessible (clickable, executable). So I wrote a simple UI Manager to update all the components simultaneously. Now I'm creating a new UI Manager for every state and have to switch it in mousemanager. Is it better to have one and have tags on uicomponents to tell which state they belong in and update them when the corresponding menu is active? Mousemanager: (1/2)
Nov 26, 2017 at 20:00 history answered ice1000 CC BY-SA 3.0