package views; import entities.Pair; //--------------------------------------------------------------- // public class Sprite { private Texture texture; private Image2D img; private Pair<Double> positionValue; private double scaleValue; //--------------------------------------------------------------- //--------------------------------------------------------------- // public Sprite(String path) { this.positionValue = new Pair<>(0d, 0d); texture = new Texture("player", path); img = new Image2D(texture); } //--------------------------------------------------------------- //--------------------------------------------------------------- // getter public double getScaleValue() { return this.scaleValue; } public Pair<Double> getPositionValue() { return this.positionValue; } //--------------------------------------------------------------- // setter public void setPositionValue(Pair<Double> positionValue) { this.positionValue = positionValue; } public void setScaleValue(double scaleValue) { this.scaleValue = scaleValue; } //--------------------------------------------------------------- //--------------------------------------------------------------- // public void draw() { img.setScale(scaleValue); img.setPosition(positionValue); img.draw(); } //--------------------------------------------------------------- // テクスチャの開放 public void delete() { texture.delete(); } //--------------------------------------------------------------- }