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

2016/4/14

How to create an interface

Vicidsmart Vicidsmart

2016/4/14

#
I just don't know where to click to create one. I only know how to create worlds and actors.
danpost danpost

2016/4/14

#
Vicidsmart wrote...
I just don't know where to click to create one. I only know how to create worlds and actors.
On the menubar, try 'Edit>New Class...'. Just change the word 'class' to 'interface' in the editor. Of course, you could create any type class (World subclass or Actor subclass, for examples) and clear it of all initial code and start by adding the following to the class:
// any imports needed here

public interface InterfaceName() // adjust name as you see fit
{
    // body of class here
}
The greenfoot application should be able to sort out where the class should be shown (in 'Other classes' section) when you close the editor.
You need to login to post a reply.