Class ImageItem

java.lang.Object
ch.epfl.cs107.play.window.swing.ImageItem
All Implemented Interfaces:
Item, Comparable<Item>

public final class ImageItem extends Object implements Item
Draw a single image.
  • Constructor Details

    • ImageItem

      public ImageItem(float depth, float alpha, Transform transform, SwingImage image)
      Creates a new image item.
      Parameters:
      depth - (float): associated depth
      alpha - (float): transparency, between 0 (invisible) and 1 (opaque)
      transform - (Transform): transform used, not null
      image - (SwingImage): swing image, not null
  • Method Details

    • getDepth

      public float getDepth()
      Specified by:
      getDepth in interface Item
      Returns:
      render priority, lower-values drawn first
    • render

      public void render(Graphics2D g)
      Description copied from interface: Item
      Renders the item.
      Specified by:
      render in interface Item
      Parameters:
      g - target context, not null