aboutsummaryrefslogtreecommitdiff
path: root/mod/src/main/resources/assets
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2023-01-26 03:05:00 +0900
committersyeyoung <cyoung06@naver.com>2023-01-26 03:05:00 +0900
commit500611d7684d7cf136f96f0049fee65529be3080 (patch)
treefbe642554cad4d1f927ac5bcad3a05901dcc2861 /mod/src/main/resources/assets
parent8f2366c1fd9850c0689306419343265099cfca7a (diff)
downloadSkyblock-Dungeons-Guide-500611d7684d7cf136f96f0049fee65529be3080.tar.gz
Skyblock-Dungeons-Guide-500611d7684d7cf136f96f0049fee65529be3080.tar.bz2
Skyblock-Dungeons-Guide-500611d7684d7cf136f96f0049fee65529be3080.zip
Rounded Rectangles!
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/resources/assets')
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/gui/testpopup.gui4
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/gui/testview.gui2
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/shaders/roundrect.frag16
3 files changed, 19 insertions, 3 deletions
diff --git a/mod/src/main/resources/assets/dungeonsguide/gui/testpopup.gui b/mod/src/main/resources/assets/dungeonsguide/gui/testpopup.gui
index 867c913f..51fdb7fa 100644
--- a/mod/src/main/resources/assets/dungeonsguide/gui/testpopup.gui
+++ b/mod/src/main/resources/assets/dungeonsguide/gui/testpopup.gui
@@ -18,7 +18,7 @@
<bgcolor backgroundColor="#33000000">
<align>
<size width="200" height="200">
- <bgcolor backgroundColor="#FFFFFFFF">
+ <RoundRect radius="10" backgroundColor="#FFFFFFFF">
<align>
<size width="50" height="30">
<ColorButton on:click="close" disabled="false"
@@ -30,7 +30,7 @@
/>
</size>
</align>
- </bgcolor>
+ </RoundRect>
</size>
</align>
</bgcolor> \ No newline at end of file
diff --git a/mod/src/main/resources/assets/dungeonsguide/gui/testview.gui b/mod/src/main/resources/assets/dungeonsguide/gui/testview.gui
index e361909d..82f79c29 100644
--- a/mod/src/main/resources/assets/dungeonsguide/gui/testview.gui
+++ b/mod/src/main/resources/assets/dungeonsguide/gui/testview.gui
@@ -25,7 +25,7 @@
<flexible fit="TIGHT">
<col mainAlign="CENTER">
<flexible fit="TIGHT">
- <bgcolor backgroundColor="#FF0000FF"/>
+ <RoundRect radius="20"/>
</flexible>
<flexible fit="TIGHT">
<padding left="20.0" right="20.0" top="10.0" bottom="10.0">
diff --git a/mod/src/main/resources/assets/dungeonsguide/shaders/roundrect.frag b/mod/src/main/resources/assets/dungeonsguide/shaders/roundrect.frag
new file mode 100644
index 00000000..9a41104a
--- /dev/null
+++ b/mod/src/main/resources/assets/dungeonsguide/shaders/roundrect.frag
@@ -0,0 +1,16 @@
+#version 110
+uniform float radius;
+uniform vec2 halfSize;
+uniform vec2 centerPos;
+uniform float smoothness;
+
+float roundedBoxSDF(vec2 CenterPosition, vec2 Size, float Radius) {
+ return length(max(abs(CenterPosition)-Size+Radius,0.0))-Radius;
+}
+
+void main() {
+ float distance = roundedBoxSDF(gl_FragCoord.xy - centerPos, halfSize, radius);
+ float smoothedAlpha = smoothstep(-smoothness,0.0, -distance);
+// gl_FragColor = mix(vec4(1.0, 1.0, 1.0, 1.0), vec4(0.0, 0.2, 1.0, smoothedAlpha), smoothedAlpha);
+ gl_FragColor = gl_Color * vec4(1.0, 1.0, 1.0, smoothedAlpha);
+} \ No newline at end of file