mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 18:05:10 +00:00
Implemented the ability to get the screen size from server
This commit is contained in:
1 parent
03aa9c2e9a
commit
c3b134b5ae
6 files changed
+67
-3
No files matched your search
@@ -0,0 +1,38 @@
|
||||
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) {
|
||||
return (int) (((double)width)*percent/100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeightPercent(double percent) {
|
||||
return (int) (((double)height)*percent/100);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user