Class Background

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

public class Background extends Entity
  • Constructor Details

    • Background

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

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

      public Background(Area area, RegionOfInterest region)
      Extended Background 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 background, may be null
    • Background

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

      public Background(String name, int width, int height, RegionOfInterest region)
      Alternative Background 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 background
      height - (int): of the desired background
      region - (RegionOfInterest): region of interest in the image for the background. 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