Class 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
      void clearData()  
      ScreenGraphics clone()  
      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.
      void drawText​(int x, int z, java.lang.String text, byte startColor)
      Draws text Source: Craftbukkits CraftMapCanvas
      void fillRect​(int x1, int z1, int x2, int z2, byte color)
      Fills an area with a specific color
      byte[] getData()  
      java.awt.Dimension getScreenDimension()  
      void line​(int x1, int z1, int x2, int z2, byte color)
      Draws a line from one coordinate to the other
      void setData​(byte[] data)  
      void setPixel​(int x, int z, byte color)
      Sets a specific pixel
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 corner
        z1 - The z coordinate of the first corner
        x2 - The x coordinate of the second corner
        z2 - The z coordinate of the second corner
        color - 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 coordinate
        z1 - The first z coordinate
        x2 - The second x coordinate
        z2 - The second z coordinate
        color - 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 image
        sourceX - The x coordinate from where the image should be drawn
        sourceZ - The z coordinate from where the image should be drawn
        destX - The x coordinate on the screen
        destZ - The z coordinate on the screen
        width - The amount of pixels that should be drawn on the x axis
        height - 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 coordinate
        z - z coordinate
        text - The text
      • setPixel

        public void setPixel​(int x,
                             int z,
                             byte color)
        Sets a specific pixel
        Parameters:
        x - The x coordinate
        z - The z coordinate
        color - The color
      • clone

        public ScreenGraphics clone()
        Overrides:
        clone in class java.lang.Object
      • clearData

        public void clearData()
      • getData

        public byte[] getData()
      • setData

        public void setData​(byte[] data)
      • getScreenDimension

        public java.awt.Dimension getScreenDimension()