Class EntityImage

java.lang.Object
megamek.client.ui.tileset.EntityImage
Direct Known Subclasses:
FighterSquadronIcon

public class EntityImage extends Object
Handles the rotated and damaged and preview images for a unit.
  • Field Details

    • base

      protected Image base
      The base (unit) image used for this icon.
    • icon

      protected Image icon
      A smaller icon used for the unit overview.
    • facings

      protected Image[] facings
  • Constructor Details

  • Method Details

    • createIcon

      public static EntityImage createIcon(Image base, Camouflage camouflage, Entity entity)
    • createIcon

      public static EntityImage createIcon(Image base, Camouflage camouflage, Entity entity, boolean withShadows)
    • createLobbyIcon

      public static EntityImage createLobbyIcon(Image base, Camouflage camouflage, Entity entity)
    • createIcon

      public static EntityImage createIcon(Image base, Image wreck, Camouflage camouflage, Entity entity, int secondaryPos)
    • createIcon

      public static EntityImage createIcon(Image base, Image wreck, Camouflage camouflage, Entity entity, int secondaryPos, boolean preview, boolean withShadows)
    • getCamouflage

      public Camouflage getCamouflage()
    • setCamouflage

      public void setCamouflage(Camouflage camouflage)
    • getDmgLvl

      public int getDmgLvl()
    • loadFacings

      public void loadFacings()
      Creates images applying damage decals, rotating and scaling.
    • rotateImage

      protected BufferedImage rotateImage(Image img, int dir)
      Rotates a given unit image into direction dir.
    • getFacing

      public Image getFacing(int facing)
    • getWreckFacing

      public Image getWreckFacing(int facing)
    • getBase

      public Image getBase()
    • getIcon

      public Image getIcon()
    • loadPreviewImage

      @Nullable public Image loadPreviewImage(boolean showDamage)
    • applyColor

      protected Image applyColor(Image image, int facing)
      Applies the unit individual or player camouflage to the icon.
    • applyDropShadow

      protected Image applyDropShadow(Image image)