Class Foreground

java.lang.Object
ch.epfl.cs107.play.engine.actor.Entity
ch.epfl.cs107.play.engine.actor.Foreground
All Implemented Interfaces:
Acoustics, Actor, Graphics, Updatable, Positionable

public class Foreground extends Entity
  • Constructor Details

    • Foreground

      public Foreground(Area area)
      Default Foreground Constructor by default the Background image is using the area title as file name
      Parameters:
      area - (Area): ownerArea. Not null
    • Foreground

      public Foreground(Area area, RegionOfInterest region)
      Extended Foreground Constructor by default the Background image is using the area title as file name
      Parameters:
      area - (Area): ownerArea. Not null
      region - (RegionOfInterest): region of interest in the image for the foreground, may be null
    • Foreground

      public Foreground(Area area, RegionOfInterest region, String name)
      Extended Foreground Constructor
      Parameters:
      area - (Area): ownerArea. Not null
      region - (RegionOfInterest): region of interest in the image for the foreground, may be null
      name - (String): Background file name (i.e only the name, with neither path, nor file extension). Not null
    • Foreground

      public Foreground(String name, int width, int height, RegionOfInterest region)
      Alternative Foreground Constructor
      Parameters:
      name - (String): Background file name (i.e only the name, with neither path, nor file extension). Not null
      width - (int): of the desired foreground
      height - (int): of the desired foreground
      region - (RegionOfInterest): region of interest in the image for the foreground, may be null
  • Method Details

    • draw

      public void draw(Canvas canvas)
      Description copied from interface: Graphics
      Renders itself on specified canvas.
      Parameters:
      canvas - target, not null