By the way, if you want your text to have the same design as the buttons, you can use the Text class. For example:
addObject(new Text("\nAlex His APCSA Project", 40), 400, 150);
would replace your title drawing in the constructor. Text is in rccookie.greenfoot.ui.basic;
Say you want to switch between worlds with a button. Then all you need is something like this in the constructor:
addObject(new TextButton(„Switch world“).addClickAction(m -> Greenfoot.setWorld(new SecondWorld())), 300, 350);
This will initialize and set a new world named SecondWorld
No, this is based on java packaging. This is basically like a folder system. Therefore, copy the whole „rccookie“ folder into your project, so that the structure is like
YourScenarioFolder
|-images
|-rccookie
|-MyWorld.java
|-MyWorld.class
|-project.greenfoot
|-More of your classes
Then you can import a class from the package like this:
// At the very top of the file just like the greenfoot import
import rccookie.ui.basic.Button;
This way you import the Button class. You can also write
import rccookie.ui.basic.*;
import rccookie.zu.advanced.*;
import rccookie.ui.util.*;
To import absolutely everything about the ui.
Actually the import greenfoot.*; statement works exactly the same, only that is does not reference a folder in your scenario‘s folder.
You can also take a look into the MyWorld source code in my demo to see how I did this.
2021/1/15
Login System/ Windows Emulator
2021/1/13
The endless room
2020/12/15
aMAZE
2020/12/10
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/9
Project: UI
2020/12/5
Windows XP: Greenfoot Edition