A simple yet powerful framework to manage both harware and software mouse with ease. Allows for setting cursor animation on both software and hardware mouse. Support for easy to make cursors using image files, descriptor textfile and zip.
FEATURES
managing software and harware mouse via a single CombinedMouse class
transparent switching between harware and software mouse
cursor animation for both sofware and harware mouse
loading a cursor using simple text-based descriptor file
loading a cursor from a folder
loading a cursor from a zip file (if you want to keep things in one place), works for zips inside jars.
flipping cursors by the multiples of 90 degrees
hiding or immobolizing mouse from any mode (both harware and software)
managing cursors and mouse using MouseManager class with a very simple interface
Is there a way to make that a standard method of MouseInput? At the moment the only two classes that implement mouse input are LWJGLMouseInput (patched) and AWTMouseInput that dose not change cursors (it has a method that simply ignores any attempts to change the cursor).
When I read this I remembered that I developed a test GameState of my own at an earlier stage when I was evaluating FengGUI. Here it is if you find any benefit of using it:
Window frame = new Window();
display.addWidget(frame);
frame.setX(20);
frame.setY(350);
frame.setSize(200, 100);
frame.setShrinkable(false);
//frame.setExpandable(true);
frame.setTitle("Woehl a Foarb...");
frame.getContentContainer().setLayoutManager(new StaticLayout());
ComboBox<String> list = new ComboBox<String>();
frame.addWidget(list);
list.setSize(150, list.getMinHeight());
list.setShrinkable(false);
list.setX(25);
list.setY(25);
list.addItem("White");
list.addItem("Green");
list.addItem("Blue");
list.addItem("Red");
//list.getPopupList().getToggableWidgetGroup().addSelectionChangedListener(new CBListener());
//try to add TextArea here but get OpenGLException
TextEditor ta = new TextEditor(false);
display.addWidget(ta);
ta.setText("Hallo Text");
ta.setX(40);
ta.setY(50);
//ta.setSize(100, ta.getAppearance().getFont().get)
ta.setSizeToMinSize();
// Update the display with the newly added components
display.layout();
}
public void update(float tpf) {
}
public void render(float tpf) {
//DisplaySystem.getDisplaySystem().getRenderer().clearBuffers();
display.display();
}
public void cleanup() {
}
}
It's very obviously testing code, but may provide something to you. ;)
First of all, the mouseManager and the handler were not designed for multithreading… Testing in multithreaded environment is needed.
As for the GUI: my guess is you have to modify some code in strategicHandler and use your own version of MouseManger that uses FengGUI handler and CombinedMouse. The easiest way would be to extract the MouseManager as an interface and then implement it. Also, you will have to adapt some code to work in the multithreaded environment (if the testing reveals any problems).
I will look at the multithreading issue and the GUI integration, and probably write the appropriate classes and fixes. However this might take up to two weeks as I am tied up with work at the moment. If you beat me to it, please share it
fendHandler.addToAttachedHandlers(strategicHandler);
// from now on you only need to do fengHandler.update()
or the other way around, adding fengHandler to strategicHandler as an attached handler... it should work both ways.
Let me know if this works. Also let me know if the handler is working in multithreaded environment without any bugs (if it has bug, then what are they).
Ok, I have managed to itegrate with FengGUI as much as possible. Further integration will only happen when FengGUI developers introduce features I have asked for on their forums.
Currently both software and hardware modes work provided you do not change the cursor or change modes.
Right now I'm improving some functionality in cursor loading and my build is half-broken. I will release the next patch when its done.
Great work with this, but I think I've found a bug, I'm using neakors skydome and when the mouse is in software mode it fades in and out with the stars but it's fine in hardware mode. Any ideas?