This site requires JavaScript, please enable it in your browser!
Greenfoot back
Xevinaly
Xevinaly wrote ...

2019/5/28

Hide Mouse Cursor

Xevinaly Xevinaly

2019/5/28

#
I've seen a couple of dead topics for this and once that was recent. The conclusion was that you can't change the image but nccb implied it might be different for hiding the cursor, is that the case?
Super_Hippo Super_Hippo

2019/5/28

#
As far as I know, you can hide the cursor using swing, but then it can't be played here if you upload it.
danpost danpost

2019/5/28

#
Super_Hippo wrote...
As far as I know, you can hide the cursor using swing, but then it can't be played here if you upload it.
I am not sure what swing has to do with it, but I am quite sure that the java.awt.Toolkit class is used (which will not work when uploaded).
Super_Hippo Super_Hippo

2019/5/28

#
I was importing all that when I got it from somewhere...
1
2
3
4
5
6
7
8
import greenfoot.core.WorldHandler; 
 
import java.awt.event.*;
import javax.swing.*;
import java.awt.Cursor;
 
import java.awt.Point;
import java.awt.Toolkit;
Well, I don't really know how it worked. I only know that it is the scenario I can't get a HTML5 translation for even after removing it.
danpost danpost

2019/5/28

#
Super_Hippo wrote...
I was importing all that when I got it from somewhere... << Code Omitted >> Well, I don't really know how it worked. I only know that it is the scenario I can't get a HTML5 translation for even after removing it.
Okay -- yes. The WorldCanvas object was a JPanel object (a swing object) acquired via the WorldHandler object. The Cursor and Toolkit classes are both part of the java.awt package. I am not even sure if it is possible to acquire the world canvas in the later versions of greenfoot to begin with.
You need to login to post a reply.