Class MouseDrawComponent

java.lang.Object
All Implemented Interfaces:
IRenderable, Tweenable, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class MouseDrawComponent
extends ImageComponent
  • Constructor Details

    • MouseDrawComponent

      public MouseDrawComponent​(double x, double y, double width, double height, Spritesheet spritesheet, java.lang.String text, java.awt.Image image)
  • Method Details

    • render

      public void render​(java.awt.Graphics2D g)
      Description copied from interface: IRenderable
      Renders the visual contents of this instance onto the provided graphics context.

      If an Entity implements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.

      This interface can be implemented in general by anything that should be rendered to the game's screen.

      Specified by:
      render in interface IRenderable
      Overrides:
      render in class ImageComponent
      Parameters:
      g - The current graphics object onto which this instance will render its visual contents.
      See Also:
      RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)
    • setBrushSize

      public void setBrushSize​(double newSize)
    • getDrawingColor

      public java.awt.Color getDrawingColor()
    • setDrawingColor

      public void setDrawingColor​(java.awt.Color color)
    • mouseDragged

      public void mouseDragged​(java.awt.event.MouseEvent e)
      Specified by:
      mouseDragged in interface java.awt.event.MouseMotionListener
      Overrides:
      mouseDragged in class GuiComponent
    • clearDrawingSpace

      public void clearDrawingSpace()
    • getDrawingSpace

      public java.awt.image.BufferedImage getDrawingSpace()