Index

A B C D E F G H I L M N O P R S T U W Y 
All Classes and Interfaces|All Packages|Constant Field Values

A

act() - Method in class greenfoot.Actor
The act method is called by the greenfoot framework to give actors a chance to perform some action.
act() - Method in class greenfoot.World
Act method for world.
Actor - Class in greenfoot
An Actor is an object that exists in the Greenfoot world.
Actor() - Constructor for class greenfoot.Actor
Construct an Actor.
addedToWorld(World) - Method in class greenfoot.Actor
This method is called by the Greenfoot system when this actor has been inserted into the world.
addObject(Actor, int, int) - Method in class greenfoot.World
Add an Actor to the world.
ask(String) - Static method in class greenfoot.Greenfoot
Get input from the user (and freeze the scenario while we are waiting).

B

BLACK - Static variable in class greenfoot.Color
The color black.
BLUE - Static variable in class greenfoot.Color
The color blue.
brighter() - Method in class greenfoot.Color
Creates a new color that is a brighter version of this GreenfootColor.

C

clear() - Method in class greenfoot.GreenfootImage
Clears the image.
Color - Class in greenfoot
A representation of a Color.
Color(int, int, int) - Constructor for class greenfoot.Color
Creates a RGB color with the specified red, green, blue values in the range (0 - 255).
Color(int, int, int, int) - Constructor for class greenfoot.Color
Creates a RGB color with the specified red, green, blue, and alpha values in the range (0 - 255).
CYAN - Static variable in class greenfoot.Color
The color cyan.

D

DARK_GRAY - Static variable in class greenfoot.Color
The color dark gray.
darker() - Method in class greenfoot.Color
Creates a new GreenfootColor that is a darker version of this GreenfootColor.
delay(int) - Static method in class greenfoot.Greenfoot
Delay the current execution by a number of time steps.
deriveFont(float) - Method in class greenfoot.Font
Creates a new Font object by cloning the current one and then applying a new size to it.
drawImage(GreenfootImage, int, int) - Method in class greenfoot.GreenfootImage
Draws the given Image onto this image
drawLine(int, int, int, int) - Method in class greenfoot.GreenfootImage
Draw a line, using the current drawing color, between the points (x1, y1) and (x2, y2).
drawOval(int, int, int, int) - Method in class greenfoot.GreenfootImage
Draw an oval bounded by the specified rectangle with the current drawing color.
drawPolygon(int[], int[], int) - Method in class greenfoot.GreenfootImage
Draws a closed polygon defined by arrays of x and y coordinates.
drawRect(int, int, int, int) - Method in class greenfoot.GreenfootImage
Draw the outline of the specified rectangle.
drawShape(Shape) - Method in class greenfoot.GreenfootImage
Draw a shape directly on the image.
drawString(String, int, int) - Method in class greenfoot.GreenfootImage
Draw the text given by the specified string, using the current font and color.

E

equals(Object) - Method in class greenfoot.Color
Determines whether another object is equal to this color.
equals(Object) - Method in class greenfoot.Font
* Determines whether another object is equal to this font.

F

fill() - Method in class greenfoot.GreenfootImage
Fill the entire image with the current drawing color.
fillOval(int, int, int, int) - Method in class greenfoot.GreenfootImage
Fill an oval bounded by the specified rectangle with the current drawing color.
fillPolygon(int[], int[], int) - Method in class greenfoot.GreenfootImage
Fill a closed polygon defined by arrays of x and y coordinates.
fillRect(int, int, int, int) - Method in class greenfoot.GreenfootImage
Fill the specified rectangle.
Font - Class in greenfoot
A representation of a Font.
Font(boolean, boolean, int) - Constructor for class greenfoot.Font
Creates a sans serif font with the specified size and style.
Font(int) - Constructor for class greenfoot.Font
Creates a sans serif font of a given size.
Font(String, boolean, boolean, int) - Constructor for class greenfoot.Font
Creates a font from the specified font name, size and style.
Font(String, int) - Constructor for class greenfoot.Font
Creates a font from the specified font name and size.

G

getActor() - Method in class greenfoot.MouseInfo
Return the actor (if any) that the current mouse behaviour is related to.
getAlpha() - Method in class greenfoot.Color
Returns the alpha component in the range 0-255.
getAwtImage() - Method in class greenfoot.GreenfootImage
Returns the java.awt.image.BufferedImage that backs this GreenfootImage.
getBackground() - Method in class greenfoot.World
Return the world's background image.
getBlue() - Method in class greenfoot.Color
Returns the blue component in the range 0-255 in the default RGB space.
getButton() - Method in class greenfoot.MouseInfo
The number of the pressed or clicked button (if any).
getCellSize() - Method in class greenfoot.World
Return the size of a cell (in pixels).
getClickCount() - Method in class greenfoot.MouseInfo
Return the number of mouse clicks associated with this mouse event.
getColor() - Method in class greenfoot.GreenfootImage
Return the current drawing color.
getColorAt(int, int) - Method in class greenfoot.GreenfootImage
Return the color at the given pixel.
getColorAt(int, int) - Method in class greenfoot.World
Return the color at the centre of the cell.
getFont() - Method in class greenfoot.GreenfootImage
Get the current font.
getGreen() - Method in class greenfoot.Color
Returns the green component in the range 0-255 in the default RGB space.
getHeight() - Method in class greenfoot.GreenfootImage
Return the height of the image.
getHeight() - Method in class greenfoot.World
Return the height of the world (in number of cells).
getImage() - Method in class greenfoot.Actor
Returns the image used to represent this actor.
getInt(int) - Method in class greenfoot.UserInfo
Get the value of the int at the given index (0 to NUM_INTS-1, inclusive).
getIntersectingObjects(Class<A>) - Method in class greenfoot.Actor
Return all the objects that intersect this object.
getKey() - Static method in class greenfoot.Greenfoot
Get the most recently pressed key, since the last time this method was called.
getMicLevel() - Static method in class greenfoot.Greenfoot
Get the microphone input level.
getMouseInfo() - Static method in class greenfoot.Greenfoot
Return a mouse info object with information about the state of the mouse.
getMyInfo() - Static method in class greenfoot.UserInfo
Get the data stored for the current user.
getName() - Method in class greenfoot.Font
Returns the logical name of this font.
getNearby(int) - Static method in class greenfoot.UserInfo
Get a sorted list of the UserInfo items for this scenario surrounding the current user.
getNeighbours(int, boolean, Class<A>) - Method in class greenfoot.Actor
Return the neighbours to this object within a given distance.
getObjects(Class<A>) - Method in class greenfoot.World
Get all the objects in the world, or all the objects of a particular class.
getObjectsAt(int, int, Class<A>) - Method in class greenfoot.World
Return all objects at a given cell.
getObjectsAtOffset(int, int, Class<A>) - Method in class greenfoot.Actor
Return all objects that intersect the center of the given location (relative to this object's location).
getObjectsInRange(int, Class<A>) - Method in class greenfoot.Actor
Return all objects within range 'radius' around this object.
getOneIntersectingObject(Class<?>) - Method in class greenfoot.Actor
Return an object that intersects this object.
getOneObjectAtOffset(int, int, Class<?>) - Method in class greenfoot.Actor
Return one object that is located at the specified cell (relative to this objects location).
getRandomNumber(int) - Static method in class greenfoot.Greenfoot
Return a random number between 0 (inclusive) and limit (exclusive).
getRank() - Method in class greenfoot.UserInfo
Get the users overall rank for this scenario.
getRed() - Method in class greenfoot.Color
Returns the red component in the range 0-255 in the default RGB space.
getRotation() - Method in class greenfoot.Actor
Return the current rotation of this actor.
getScore() - Method in class greenfoot.UserInfo
Get the user's score.
getSize() - Method in class greenfoot.Font
Returns the point size of this font, rounded to an integer.
getString(int) - Method in class greenfoot.UserInfo
Get the value of the String at the given index (0 to NUM_STRINGS-1, inclusive).
getTop(int) - Static method in class greenfoot.UserInfo
Get a sorted list of the UserInfo items for this scenario, starting at the top.
getTransparency() - Method in class greenfoot.GreenfootImage
Return the current transparency of the image.
getUserImage() - Method in class greenfoot.UserInfo
Return an image of the user.
getUserName() - Method in class greenfoot.UserInfo
Get the username of the user that this storage belongs to.
getVolume() - Method in class greenfoot.GreenfootSound
Get the current volume of the sound, between 0 (off) and 100 (loudest.)
getWidth() - Method in class greenfoot.GreenfootImage
Return the width of the image.
getWidth() - Method in class greenfoot.World
Return the width of the world (in number of cells).
getWorld() - Method in class greenfoot.Actor
Return the world that this actor lives in.
getWorldOfType(Class<W>) - Method in class greenfoot.Actor
Return the world that this actor lives in, provided that it is an instance of the given "worldClass" class (i.e.
getX() - Method in class greenfoot.Actor
Return the x-coordinate of the actor's current location.
getX() - Method in class greenfoot.MouseInfo
Return the current x position of the mouse cursor.
getY() - Method in class greenfoot.Actor
Return the y-coordinate of the object's current location.
getY() - Method in class greenfoot.MouseInfo
Return the current y position of the mouse cursor.
GRAY - Static variable in class greenfoot.Color
The color gray.
GREEN - Static variable in class greenfoot.Color
The color green.
greenfoot - package greenfoot
 
Greenfoot - Class in greenfoot
This utility class provides methods to control the simulation and interact with the system.
Greenfoot() - Constructor for class greenfoot.Greenfoot
 
GreenfootImage - Class in greenfoot
An image to be shown on screen.
GreenfootImage(int, int) - Constructor for class greenfoot.GreenfootImage
Create an empty (transparent) image with the specified size.
GreenfootImage(GreenfootImage) - Constructor for class greenfoot.GreenfootImage
Create a GreenfootImage from another GreenfootImage.
GreenfootImage(String) - Constructor for class greenfoot.GreenfootImage
Create an image from an image file.
GreenfootImage(String, int, Color, Color) - Constructor for class greenfoot.GreenfootImage
Creates an image with the given string drawn as text using the given font size, with the given foreground Color on the given background Color.
GreenfootImage(String, int, Color, Color, Color) - Constructor for class greenfoot.GreenfootImage
Creates an image with the given string drawn as text using the given font size, with the given foreground color on the given background color.
GreenfootSound - Class in greenfoot
Represents audio that can be played in Greenfoot.
GreenfootSound(String) - Constructor for class greenfoot.GreenfootSound
Creates a new sound from the given file.

H

hashCode() - Method in class greenfoot.Color
Computes the hash code for this Color.
hashCode() - Method in class greenfoot.Font
Returns a hashcode for this font.

I

intersects(Actor) - Method in class greenfoot.Actor
Check whether this object intersects with another given object.
isAtEdge() - Method in class greenfoot.Actor
Detect whether the actor has reached the edge of the world.
isBold() - Method in class greenfoot.Font
Indicates whether or not this Font style is bold.
isItalic() - Method in class greenfoot.Font
Indicates whether or not this Font style is italic.
isKeyDown(String) - Static method in class greenfoot.Greenfoot
Check whether a given key is currently pressed down.
isPlain() - Method in class greenfoot.Font
Indicates whether or not this Font style is plain.
isPlaying() - Method in class greenfoot.GreenfootSound
True if the sound is currently playing.
isStorageAvailable() - Static method in class greenfoot.UserInfo
Indicate whether storage is available.
isTouching(Class<?>) - Method in class greenfoot.Actor
Checks whether this actor is touching any other objects of the given class.

L

LIGHT_GRAY - Static variable in class greenfoot.Color
The color light gray.

M

MAGENTA - Static variable in class greenfoot.Color
The color magenta.
mirrorHorizontally() - Method in class greenfoot.GreenfootImage
Mirrors the image horizontally (the left of the image becomes the right, and vice versa).
mirrorVertically() - Method in class greenfoot.GreenfootImage
Mirrors the image vertically (the top of the image becomes the bottom, and vice versa).
mouseClicked(Object) - Static method in class greenfoot.Greenfoot
True if the mouse has been released (changed from pressed to non-pressed) on the given object.
mouseDragEnded(Object) - Static method in class greenfoot.Greenfoot
True if a mouse drag has ended.
mouseDragged(Object) - Static method in class greenfoot.Greenfoot
True if the mouse is currently being dragged on the given object.
MouseInfo - Class in greenfoot
This class contains information about the current status of the mouse.
mouseMoved(Object) - Static method in class greenfoot.Greenfoot
True if the mouse has been moved on the given object.
mousePressed(Object) - Static method in class greenfoot.Greenfoot
True if the mouse has been pressed (changed from a non-pressed state to being pressed) on the given object.
move(int) - Method in class greenfoot.Actor
Move this actor the specified distance in the direction it is currently facing.

N

NUM_INTS - Static variable in class greenfoot.UserInfo
The number of integers that can be stored
NUM_STRINGS - Static variable in class greenfoot.UserInfo
The number of Strings that can be stored
numberOfObjects() - Method in class greenfoot.World
Get the number of actors currently in the world.

O

ORANGE - Static variable in class greenfoot.Color
The color orange.

P

pause() - Method in class greenfoot.GreenfootSound
Pauses the current sound if it is currently playing.
PINK - Static variable in class greenfoot.Color
The color pink.
play() - Method in class greenfoot.GreenfootSound
Start playing this sound.
playLoop() - Method in class greenfoot.GreenfootSound
Play this sound repeatedly in a loop.
playSound(String) - Static method in class greenfoot.Greenfoot
Play sound from a file.

R

RED - Static variable in class greenfoot.Color
The color red.
removeObject(Actor) - Method in class greenfoot.World
Remove an object from the world.
removeObjects(Collection<? extends Actor>) - Method in class greenfoot.World
Remove a list of objects from the world.
removeTouching(Class<?>) - Method in class greenfoot.Actor
Removes one object of the given class that this actor is currently touching (if any exist).
repaint() - Method in class greenfoot.World
Repaints the world.
rotate(int) - Method in class greenfoot.GreenfootImage
Rotates this image around the center.

S

scale(int, int) - Method in class greenfoot.GreenfootImage
Scales this image to a new size.
setActOrder(Class...) - Method in class greenfoot.World
Set the act order of objects in the world.
setBackground(GreenfootImage) - Method in class greenfoot.World
Set a background image for the world.
setBackground(String) - Method in class greenfoot.World
Set a background image for the world from an image file.
setColor(Color) - Method in class greenfoot.GreenfootImage
Set the current drawing color.
setColorAt(int, int, Color) - Method in class greenfoot.GreenfootImage
Sets the given pixel to the given color.
setFont(Font) - Method in class greenfoot.GreenfootImage
Set the current font.
setImage(GreenfootImage) - Method in class greenfoot.Actor
Set the image for this actor to the specified image.
setImage(String) - Method in class greenfoot.Actor
Set an image for this actor from an image file.
setInt(int, int) - Method in class greenfoot.UserInfo
Set the value of the int at the given index (0 to NUM_INTS-1, inclusive).
setLocation(int, int) - Method in class greenfoot.Actor
Assign a new location for this actor.
setPaintOrder(Class...) - Method in class greenfoot.World
Set the paint order of objects in the world.
setRotation(int) - Method in class greenfoot.Actor
Set the rotation of this actor.
setScore(int) - Method in class greenfoot.UserInfo
Set the user's score.
setSpeed(int) - Static method in class greenfoot.Greenfoot
Set the speed of the execution.
setString(int, String) - Method in class greenfoot.UserInfo
Get the value of the String at the given index (0 to NUM_STRINGS-1, inclusive).
setTransparency(int) - Method in class greenfoot.GreenfootImage
Set the transparency of the image.
setVolume(int) - Method in class greenfoot.GreenfootSound
Set the current volume of the sound between 0 (off) and 100 (loudest.)
setWorld(World) - Static method in class greenfoot.Greenfoot
Sets the World to run to the one given.
showText(String, int, int) - Method in class greenfoot.World
Show some text centred at the given position in the world.
sleepFor(int) - Method in class greenfoot.Actor
Sets this actor to sleep for the given number of cycles.
start() - Static method in class greenfoot.Greenfoot
Run (or resume) the execution.
started() - Method in class greenfoot.World
This method is called by the Greenfoot system when the execution has started.
stop() - Static method in class greenfoot.Greenfoot
Pause the execution.
stop() - Method in class greenfoot.GreenfootSound
Stop playing this sound if it is currently playing.
stopped() - Method in class greenfoot.World
This method is called by the Greenfoot system when the execution has stopped.
store() - Method in class greenfoot.UserInfo
Store the data to the server.
STRING_LENGTH_LIMIT - Static variable in class greenfoot.UserInfo
The maximum number of characters that can be stored in each String

T

toString() - Method in class greenfoot.Color
Return a text representation of the color.
toString() - Method in class greenfoot.Font
Return a text representation of the font.
toString() - Method in class greenfoot.GreenfootImage
Return a text representation of the image.
toString() - Method in class greenfoot.GreenfootSound
Returns a string representation of this sound containing the name of the file and whether it is currently playing or not.
toString() - Method in class greenfoot.MouseInfo
 
turn(int) - Method in class greenfoot.Actor
Turn this actor by the specified amount (in degrees).
turnTowards(int, int) - Method in class greenfoot.Actor
Turn this actor to face towards a certain location.

U

UserInfo - Class in greenfoot
The UserInfo class can be used to store data permanently on a server, and to share this data between different users, when the scenario runs on the Greenfoot web site.

W

WHITE - Static variable in class greenfoot.Color
The color white.
World - Class in greenfoot
World is the world that Actors live in.
World(int, int, int) - Constructor for class greenfoot.World
Construct a new world.
World(int, int, int, boolean) - Constructor for class greenfoot.World
Construct a new world.

Y

YELLOW - Static variable in class greenfoot.Color
The color yellow.
A B C D E F G H I L M N O P R S T U W Y 
All Classes and Interfaces|All Packages|Constant Field Values