///!ImageObject Script!///
package com.example.j9.triqshot;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.View;

public class ImageObject{
//Image Size
public int width;
public int height;

//Image Position
public long X;
public long Y;

//Image Content
private Bitmap image;

//Image Constructor
public ImageObject(long X, long Y, int width, int height, Bitmap image){
   this.X = X;
   this.Y = Y;
   this.width = width;
   this.height = height;
   this.image = Bitmap.createScaledBitmap(image, width, height, false);
  }

//Image Graphics
public void draw(Canvas canvas){
   canvas.drawBitmap(image, X, Y, null);
  }

//Set Image Content
public void setImage(Bitmap IMG){
   image = IMG;
   image = Bitmap.createScaledBitmap(image, width, height, false);
  }
}

///!FrameObject Script!///

package com.example.j9.triqshot;

import android.graphics.Bitmap;

public class FrameObject extends ImageObject {
//Animation Information
private int currentFrame = 0;
private Bitmap[] FrameArray;

//Animation Constructor
public FrameObject (int X, int Y, int width, int height, Bitmap image, int FrameArraySize) {
   super(X, Y, width, height, image);
   FrameArray = new Bitmap[FrameArraySize];
   FrameArray[0] = image;
  }

//Add frame to animation
public void AddFrame(int FrameNumber, Bitmap frame){
   FrameArray[FrameNumber] = frame;
  }

//Set currentFrame
public void SetCurrentFrame(int FrameNumber){
   currentFrame = FrameNumber;
   this.setImage(FrameArray[currentFrame]);
  }

}