Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [SOLVED]Change cursor default-image (LIBGDX)  (Read 2299 times)
0 Members and 1 Guest are viewing this topic.
Offline Andre Lopes
« Posted 2013-08-04 16:37:11 »

Heya guys, i was wondering if thats possible and if it have any drawbacks like "lag/slowdown"...

I read this btw
https://code.google.com/p/libgdx/issues/detail?id=642
Offline Jeremy
« Reply #1 - Posted 2013-08-04 16:45:00 »

The suggestion regarding drawing it as a sprite via the SpriteBatch makes most sense to me. There shouldn't be any frame drops due to it. When they talk about lag they must be referring to how sync the cursor position is to the drawn cursor's position - it may lag behind - but it should only do so very minimally.

If it does, either use the point you are rendering your cursor at as your games cursor position (and use that cursor position for all your UI logic) or ignore it because it probably isn't bad. Most games typically keep their own cursor position and simply measure the delta of mouse movement and add to that.

However, the cursor synchronization issue seems to be a moot argument because you will encounter the same sort of issue with your game outside of cursor animation - like interacting with Game UI components that use the cursor position - like windows (dragging them).

I use a similar method via Java2D to render my cursor - works fine for me.

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Offline Andre Lopes
« Reply #2 - Posted 2013-08-04 16:56:19 »

hm. Ok!
i will try that as well! and will post the results Cheesy

Btw, im working on my final college project for graduation, should i do like the guys here do? post it in " work in progress"? what should i do?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2013-08-04 17:34:18 »

to me its unacceptable with the lag. hardware cursor vs software cursor is just so noticable...

and lwjgl actually supports custom cursor.
so I guess call the lwjgl stuff directly if its pc only.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #4 - Posted 2013-08-04 17:40:50 »

hm. Ok!
i will try that as well! and will post the results Cheesy

Btw, im working on my final college project for graduation, should i do like the guys here do? post it in " work in progress"? what should i do?
Post it in WIP if you're working on it.
Offline Andre Lopes
« Reply #5 - Posted 2013-11-27 22:33:47 »

Im sorry to revive this topic.
In the time i couldnt figure how to do this.
Now i did it, and heres the code for anyone who needs ,ok?

1  
2  
3  
4  
5  
6  
Pixmap pm = new Pixmap(Gdx.files.internal("imagens/Resources/ui/mouse/pasmateRs_crosshairs64/crosshair.png"));
        int xHotSpot = pm.getWidth() / 2;
        int yHotSpot = pm.getHeight() / 2;
       
        Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
        pm.dispose();
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (28 views)
2014-12-15 09:26:44

Mr.CodeIt (19 views)
2014-12-14 19:50:38

BurntPizza (35 views)
2014-12-09 22:41:13

BurntPizza (70 views)
2014-12-08 04:46:31

JscottyBieshaar (32 views)
2014-12-05 12:39:02

SHC (44 views)
2014-12-03 16:27:13

CopyableCougar4 (40 views)
2014-11-29 21:32:03

toopeicgaming1999 (108 views)
2014-11-26 15:22:04

toopeicgaming1999 (94 views)
2014-11-26 15:20:36

toopeicgaming1999 (29 views)
2014-11-26 15:20:08
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!