Newer
Older
JumpingGame / src / main / java / views / PlayerRenderer.java
k-fujii on 15 Nov 2021 1 KB Vec2の削除
package views;

import entities.Image2D;
import entities.Pair;
import entities.Texture;

//---------------------------------------------------------------
//
public class PlayerRenderer implements IView {

    private Texture texture;
    private Image2D img;

    //---------------------------------------------------------------
    //---------------------------------------------------------------
    //
    public PlayerRenderer(String path, Pair<Double> position) {
        texture = new Texture("player", path);
        img = new Image2D(texture, position.getFirst(), position.getSecond());
    }

    //---------------------------------------------------------------
    //---------------------------------------------------------------
    //
    public void display() {
        img.draw();
    }

    //---------------------------------------------------------------
    // テクスチャの開放
    public void delete(){
        texture.delete();
    }
    //---------------------------------------------------------------
}