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

2015/7/2

Clicking Problems

Gamercheez Gamercheez

2015/7/2

#
Is there any way to click through an actor. I want the player to click on something, but another object is on top of it. Greenfoot thinks that I want to click on the object on top.
danpost danpost

2015/7/2

#
Please elaborate. Are the objects of the same type? Would a change in paint order work or does the one clickable object need to be "behind" the other? Giving the actual type of objects involved and a synopsis of what they are for may help in us getting an idea of what you actually need.
Gamercheez Gamercheez

2015/7/5

#
I have a block that can be clicked on to break like a mining sort of thing, but during a boss battle, there's a target that shows that the "invasion" is going on. It's a GUI object, so I have it on top, so it's always visible. If the target is over the block, I can't click on it.
danpost danpost

2015/7/5

#
I would suggest that you add code to the 'act' method of the target class to inform the world that a click needs to be processed. That is, when the target is found to have been clicked on, call a method in the world subclass to break up any block at the clicked location.
Gamercheez Gamercheez

2015/7/5

#
OK, thanks. I'll try that.
You need to login to post a reply.