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

2015/12/10

Drop down help

Chapaladeen Chapaladeen

2015/12/10

#
I really need some help that isn't just a link to some pre-made code. I find those kind of difficult to trace what's happening and I don't have the time to look over it properly. Okay, so currently I am making a project which is basically just a game of Cluedo. I want to make it so that there are two drop down boxes displayed which both show different card types (Characters and weapon). The user then selects an option and clicks "Suggest" and then the other users get to take it in turns to disprove that. I know how to do all of the logic, but I have been just having trouble with visual things such as drop down boxes. If anyone can make a suggestion of at least how to go about doing this then that would be greatly appreciated.
danpost danpost

2015/12/10

#
The basic thing is to have an Actor object as the base object of the selectors. The size of the base object can be expanded to encompass the selectors when open. This means relocating the location when expanding and collapsing so that the top-left corner is stationary. The selectors should be simple Actor objects that the detection of mouse clicks are tested on. The selectors should be held in reference fields in the base objects so that adding and removing them can be done easily, as well as detection of clicks. These base object should either have accessible identification or references to the two base object should be held by your current World object in fields.
You need to login to post a reply.