5/21/2023 0 Comments Greenfoot actor api![]() World public World(int worldWidth, int worldHeight, int cellSize, boolean bounded)Ĭonstruct a new world. worldHeight - The height of the world (in cells). Parameters: worldWidth - The width of the world (in cells). The size of the world (in number of cells) and the size of each cell (in pixels) must be specified. Methods inherited from class clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitĬonstructor Detail World public World(int worldWidth, int worldHeight, int cellSize)Ĭonstruct a new world. This method is called by the Greenfoot system when the execution has stopped. This method is called by the Greenfoot system when the execution has started. Show some text centred at the given position in the world. Set the paint order of objects in the world. Set a background image for the world from an image file. Set the act order of objects in the world. Get the number of actors currently in the world. Return the width of the world (in number of cells). Get all the objects in the world, or all the objects of a particular class. Return the height of the world (in number of cells). Return the color at the centre of the cell. void addObject(Actor object, int x, int y)Īdd an Actor to the world. World(int worldWidth, int worldHeight, int cellSize, boolean bounded)Īct method for world. Version: 2.6 Author: Poul Henriksen, Michael Kolling See Also: ActorĬonstructor Summary World(int worldWidth, int worldHeight, int cellSize)Ĭonstruct a new world. The world background can be decorated with drawings or images. More elaborate scenarios may use smaller cells (down to single pixel size) to achieve fine-grained placement and smoother animation. Simple scenarios may use large cells that entirely contain the representations of objects in a single cell. The size of cells can be specified at world creation time, and is constant after creation. All Actor are associated with a World and can get access to the world object. Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHODįRAMES NO FRAMES All Classes DETAIL: FIELD | CONSTR | METHODĬlass World greenfoot.World File:///C:/Program Files/Greenfoot/doc/API/greenfoot/World.html
0 Comments
Leave a Reply. |