package entities; import views.IView; //--------------------------------------------------------------- // public class Sprite { private Pair<Double> positionValue; private double scaleValue; private Texture texture; private Image2D img; //--------------------------------------------------------------- //--------------------------------------------------------------- // public Sprite(String path) { this.positionValue = new Pair<>(0d, 0d); texture = new Texture("player", path); img = new Image2D(texture); } //--------------------------------------------------------------- //--------------------------------------------------------------- // 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(); } //--------------------------------------------------------------- }