aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens
diff options
context:
space:
mode:
authormsg-programs <msgdoesstuff@gmail.com>2023-05-28 11:46:05 +0200
committermsg-programs <msgdoesstuff@gmail.com>2023-05-28 11:46:05 +0200
commiteeaae397b0000b725e2a1cb63613b28e712a6d68 (patch)
treeef3cdbd65f2420710889af6e6594a5fa33a4b99d /src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens
parentb446021b397fd70c98ac6dab595b8df6d026d355 (diff)
downloadSkyblocker-eeaae397b0000b725e2a1cb63613b28e712a6d68.tar.gz
Skyblocker-eeaae397b0000b725e2a1cb63613b28e712a6d68.tar.bz2
Skyblocker-eeaae397b0000b725e2a1cb63613b28e712a6d68.zip
Add javadoc comments to key classes.
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens/Screen.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens/Screen.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens/Screen.java
index ae71d7bd..cca2ed9e 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens/Screen.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screens/Screen.java
@@ -82,10 +82,16 @@ public class Screen {
};
}
+ /**
+ * Add a widget to this screen
+ */
public void addWidget(Widget w) {
widgets.add(w);
}
+ /**
+ * Add many widgets to this screen
+ */
public void addWidgets(Widget... ws) {
for (Widget w : ws) {
widgets.add(w);
@@ -98,6 +104,9 @@ public class Screen {
}
}
+ /**
+ * Stack these widgets on top of each other as determined by the lists's order
+ */
public void stackWidgetsH(Widget... list) {
int compHeight = -5;
for (Widget wid : list) {
@@ -111,6 +120,9 @@ public class Screen {
}
}
+ /**
+ * Arrange these widgets next to each other as determined by the lists's order
+ */
public void stackWidgetsW(Widget... list) {
// TODO not centered
int compWidth = -5;
@@ -125,24 +137,39 @@ public class Screen {
}
}
+ /**
+ * Center a widget vertically, keeping X pos
+ */
public void centerH(Widget wid) {
wid.setY((h - wid.getHeight()) / 2);
}
+ /**
+ * Center a widget horizontally, keeping Y pos
+ */
public void centerW(Widget wid) {
wid.setX((w - wid.getWidth()) / 2);
}
+ /**
+ * Center a widget vertically and horizontally
+ */
public void center(Widget wid) {
this.centerH(wid);
this.centerW(wid);
}
+ /**
+ * Let a widget's left border be on the screen's center, keeping Y pos
+ */
public void offCenterL(Widget wid) {
int wHalf = this.w / 2;
wid.setX(wHalf - 3 - wid.getWidth());
}
+ /**
+ * Let a widget's right border be on the screen's center, keeping Y pos
+ */
public void offCenterR(Widget wid) {
int wHalf = this.w / 2;
wid.setX(wHalf + 3);