Package de.cerus.packetmaps.core.screen
Class ScreenGraphics
- java.lang.Object
-
- de.cerus.packetmaps.core.screen.ScreenGraphics
-
public class ScreenGraphics extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ScreenGraphics(java.awt.Dimension screenDimension, NmsAdapter nmsAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearData()ScreenGraphicsclone()voiddrawImage(java.awt.image.BufferedImage image, int sourceX, int sourceZ, int destX, int destZ, int width, int height)Draws a part of an image at the specified coordinates If the specified width or height with exceed the bounds of the screen the image will be truncated.voiddrawText(int x, int z, java.lang.String text, byte startColor)Draws text Source: Craftbukkits CraftMapCanvasvoidfillRect(int x1, int z1, int x2, int z2, byte color)Fills an area with a specific colorbyte[]getData()java.awt.DimensiongetScreenDimension()voidline(int x1, int z1, int x2, int z2, byte color)Draws a line from one coordinate to the othervoidsetData(byte[] data)voidsetPixel(int x, int z, byte color)Sets a specific pixel
-
-
-
Constructor Detail
-
ScreenGraphics
public ScreenGraphics(java.awt.Dimension screenDimension, NmsAdapter nmsAdapter)
-
-
Method Detail
-
fillRect
public void fillRect(int x1, int z1, int x2, int z2, byte color)Fills an area with a specific color- Parameters:
x1- The x coordinate of the first cornerz1- The z coordinate of the first cornerx2- The x coordinate of the second cornerz2- The z coordinate of the second cornercolor- The color of the rectangle
-
line
public void line(int x1, int z1, int x2, int z2, byte color)Draws a line from one coordinate to the other- Parameters:
x1- The first x coordinatez1- The first z coordinatex2- The second x coordinatez2- The second z coordinatecolor- The color of the line
-
drawImage
public void drawImage(java.awt.image.BufferedImage image, int sourceX, int sourceZ, int destX, int destZ, int width, int height)Draws a part of an image at the specified coordinates If the specified width or height with exceed the bounds of the screen the image will be truncated.- Parameters:
image- The imagesourceX- The x coordinate from where the image should be drawnsourceZ- The z coordinate from where the image should be drawndestX- The x coordinate on the screendestZ- The z coordinate on the screenwidth- The amount of pixels that should be drawn on the x axisheight- The amount of pixels that should be drawn on the z axis
-
drawText
public void drawText(int x, int z, java.lang.String text, byte startColor)Draws text Source: Craftbukkits CraftMapCanvas- Parameters:
x- x coordinatez- z coordinatetext- The text
-
setPixel
public void setPixel(int x, int z, byte color)Sets a specific pixel- Parameters:
x- The x coordinatez- The z coordinatecolor- The color
-
clone
public ScreenGraphics clone()
- Overrides:
clonein classjava.lang.Object
-
clearData
public void clearData()
-
getData
public byte[] getData()
-
setData
public void setData(byte[] data)
-
getScreenDimension
public java.awt.Dimension getScreenDimension()
-
-