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

2020/11/21

How to implement a Footer UI Component in Greenfoot?

Dev_grey97 Dev_grey97

2020/11/21

#
Hi, I want to have in my Game a footer UI component, which only has a few Counter Components and a Button Component. How do I create the footer component in Greenfoot? Should I create it as an Actor component? If so, how do I place the Counter and Buttons Actors into it?
danpost danpost

2020/11/21

#
Dev_grey97 wrote...
How do I create the footer component in Greenfoot? Should I create it as an Actor component? If so, how do I place the Counter and Buttons Actors into it?
Probably best is to use an actor. There are cases where you may not need to go that route; but an actor will work in most, if not all, cases. Obviously, you will have 3 types of actors -- a counter, a button and a panel (backdrop of footer area). The main class would be for the panel (or "footer" class) itself. The objects for the panel can be basic Actor objects controlled by the panel. These are "value" or "text" display objects. You can refer to my Value Display Tutorial scenario to help create these objects. Make use of the addedToWorld method in your panel class to place the other components.
You need to login to post a reply.