
com.brashmonkey.spriter.SpriterPoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Spriter Show documentation
Show all versions of Spriter Show documentation
A generic Java library for Spriter animation files.
package com.brashmonkey.spriter;
public class SpriterPoint {
public float x,y;
public SpriterPoint(float x, float y){
this.set(x, y);
}
public void translate(float x, float y){
this.x += x;
this.y += y;
}
public void set(float x, float y){
this.x = x;
this.y = y;
}
public void rotate(float degree){
double angle = Math.toRadians(degree);
float cos = (float)Math.cos(angle);
float sin = (float)Math.sin(angle);
float xx = x*cos-y*sin;
float yy = x*sin+y*cos;
this.x = xx;
this.y = yy;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy