How do I calibrate a stylus in a LibGDX game?

Anything libgdx related goes here!

Re: How do I calibrate a stylus in a LibGDX game?

Postby shatterblast » Sat Feb 23, 2019 3:56 pm

Because LWJGL2 lacks specific features, I suggest trying LWJGL3 instead. As for why version 2 exists, I imagine that it helps keep "compatibility" with both older stuff and certain mobile devices, like a few phone and tablet models from Samsung for example. The following link shows a relation with the issue of your stylus:

https://github.com/libgdx/libgdx/issues/5174#issuecomment-381435478


While I have used LWJGL3 only a small amount, I believe that the following code would help in your DesktopLauncher for the purpose of testing:

Code: Select all
public class DesktopLauncher {

   public static void main (String[] arg) {

        //TODO  Do awesome stuff.
        //Remember that Alt + F4 will close the game!!!


        LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

        config.title = "My Game with a Stylus";
        config.width = 1920;
        config.height = 1080;
        config.resizable = false;


        //I think LWJGL3 needs fullscreen to avoid crashing.
        config.fullscreen = true;
        config.useGL30 = true;


        new LwjglApplication(new MyGdxGame(), config);

   }
}
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: How do I calibrate a stylus in a LibGDX game?

Postby evilentity » Sat Feb 23, 2019 6:38 pm

I would expect the stylus to work as any other input device on windows, basically a mouse. If it doesnt windows is garbage, wouldnt be a huge shock.
If it just and offset it would be easy enough to implement i guess.

You sure its the styles problem and not generic input problem? If drawing/viewports are setup poorly it might be off.
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4854
Joined: Wed Aug 24, 2011 11:37 am

Re: How do I calibrate a stylus in a LibGDX game?

Postby shatterblast » Wed Mar 27, 2019 2:05 pm

smithclarkson01 wrote:In my experience tablet/stylus input isn't considered multi touch. A stylus only has one point after all (maybe a pen tip and an eraser tip if you want to be pedantic, but they can't be used at the same time).

Probably because of its open source nature, the xsetwacom software in Linux potentially supports the multi-touch feature, and certain Wacom tablets can be set to work like really large touch pads, behaving even like touch screens on phones in some measure. I believe Wacom called the feature "gestures", even though it goes a bit beyond that. I personally have done this with my Wacom tablet in the past, but I dis-regarded it. Despite the feature, I did not see a benefit for my drawings, and I just use it as a traditional drawing tablet. Of course, it zoomed fine with Krita, since it supports drawing tablets a bit better. If I correctly remember, though, it may have acted quite oddly with my PDF viewer. In a few Wacom devices, including my own, I know they support the ability for multi-touch in Windows 8.1 and 10. However, at least with my version in Windows, gestures work only with a very limited choice of programs that also requires downloading and setting up additional software from Wacom. I am not aware if MacOS offers support. I do know that some brands other than Wacom for drawing tablets also support multi-touch, probably even much better in some ways, but generally, you will not find the feature in the cheaper "budget" models from the last time I checked.

smithclarkson01 wrote:While the way tablets/styluses give their input are architecturally incompatible with some game play such as first person shooters, why would they not be compatible with something like slay the spire? Especially the issue where the input is consistently 1cm off where the stylus is pointing?

I can only suggest, like in my post above, to try the LWJGL3 configuration of LibGDX. I hope you find a better answer.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: How do I calibrate a stylus in a LibGDX game?

Postby barryallen1337 » Tue Aug 27, 2019 4:56 pm

Stylus input in generally analogous to mouse input (at least with my wacom on a desktop. I can't speak for surface Pros)

In my experience tablet/stylus input isn't considered multi touch. A stylus only has one point after all (maybe a pen tip and an eraser tip if you want to be pedantic, but they can't be used at the same time).

While the way tablets/styluses give their input are architecturally incompatible with some game play such as first person shooters, why would they not be compatible with something like slay the spire? Especially the issue where the input is consistently 1cm off where the stylus is pointing?
][url="https://get-shareit.com"]shareit[/url] [url="https://get-vidmateapk.com"]https://get-vidmateapk.com[/url]
barryallen1337
 
Posts: 2
Joined: Tue Aug 27, 2019 4:53 pm


Return to Libgdx

Who is online

Users browsing this forum: MSN [Bot] and 1 guest