femto.Image - felipemanga/FemtoIDE GitHub Wiki

Summary

Lightweight class for images without animation or transparency.

Utilization

This is an abstract class, do not instance it directly. Instead, put a PNG image in your project and then import it. For example, if inside the titleScreen folder you have an image named Background.png:

import tileScreen.Background;
...
Background bg = new Background();
bg.draw(screen, 0.0f, 0.0f);
screen.flush();
...

Methods

  • int height() Returns the height of the image in pixels.
  • int width() Returns the width of the image in pixels.
  • void draw( HiRes16Color screen, float x, float y ) same as draw( screen, x, y, false, false, false )
  • void draw( HiRes16Color screen, float x, float y, boolean mirror, boolean flip, boolean isStatic ) Draws an image. If isStatic is false, the screen's camera coordinates are taken into consideration. Set it to true for images that are part of the HUD.