Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (523)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
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  
  Mouse Pointer  (Read 945 times)
0 Members and 1 Guest are viewing this topic.
Offline Grand Poeba

Junior Devvie





« Posted 2006-01-05 23:36:58 »

Hey ive been searching the net for quite some time but i didnt find an answer so let me ask it here
is there a way to set the cursor size?

I have craeted a custom cursor by using the toolkit but it resizes my image because it is to big (62x36 pix)
But i want it to be full scale the image used as pointer so how can i do this?

thx
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #1 - Posted 2006-01-06 02:44:58 »

Cursors are very OS specific things. In many operating systems they're automatically overlayed onto the VGA signal by the video card. This causes the pointer to be restricted in its size. Windows, IIRC, uses a 32x32px cursor. Your cursor size needs to match that. If it's of a different size, I believe the OS will automatically stretch it. I don't know what size you need for Mac OS X, but I do know that it's a bit finicky about custom cursors.

So in short? No.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline woogley
« Reply #2 - Posted 2006-01-06 03:00:45 »

you can just hide the cursor (set the cursor to a transparent BufferedImage) and then have your custom image move with the mouse's coordinates ..
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Grand Poeba

Junior Devvie





« Reply #3 - Posted 2006-01-06 10:44:10 »

you can just hide the cursor (set the cursor to a transparent BufferedImage) and then have your custom image move with the mouse's coordinates ..

any idea how? with an extra internal frame ? (i work with desktoppane and internalframes)
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2006-01-06 19:23:21 »

The cursor size is set by the hardware/OS. 

As others say, the only way around this is to take over drawing the cursor as part of your game rendering. This means taking control of ALL rendering in your app's window, so forget about Swing components.

(Actually you can TRY to use Swing components with active rendering by turning their automatic rendering off and manually calling their paint() methods as appropriate but thats a whole lot of work to get right and may never do quite what you want.  I've had only minimal success doing this myself and with display's a lot less compelx thne it sounds like yours is.)

Since this sounds like very much a Swing GUI app I'd say either:
(a) Reset cursor size from your OS if it and your hardware allow it  (and no I cant tel lyou how to do that you'll have to go looking through your particular OS's control panels.)

(b) Give it up as a bad job.



Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #5 - Posted 2006-01-06 19:43:45 »

Try using the "GlassPane" if you do use Swing.

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.

SHC (24 views)
2014-11-25 12:00:59

SHC (22 views)
2014-11-25 11:53:45

Norakomi (19 views)
2014-11-25 11:26:43

Gibbo3771 (22 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (74 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (41 views)
2014-11-12 21:09:33

kovacsa (68 views)
2014-11-07 19:57:14
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!