2024-01-05 16:31:57 +03:00
|
|
|
package noppes.npcs.scripted;
|
|
|
|
|
|
|
|
|
|
import noppes.npcs.api.IScreenSize;
|
|
|
|
|
|
|
|
|
|
public class ScreenSize implements IScreenSize {
|
|
|
|
|
private int width;
|
|
|
|
|
private int height;
|
|
|
|
|
|
|
|
|
|
public ScreenSize(int width, int height) {
|
|
|
|
|
this.width = width;
|
|
|
|
|
this.height = height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setSize(int width, int height) {
|
|
|
|
|
this.width = width;
|
|
|
|
|
this.height = height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getWidth() {
|
|
|
|
|
return width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getHeight() {
|
|
|
|
|
return height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getWidthPercent(double percent) {
|
2025-03-12 20:12:01 -04:00
|
|
|
return (int) (((double) width) * percent / 100);
|
2024-01-05 16:31:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getHeightPercent(double percent) {
|
2025-03-12 20:12:01 -04:00
|
|
|
return (int) (((double) height) * percent / 100);
|
2024-01-05 16:31:57 +03:00
|
|
|
}
|
|
|
|
|
}
|