diff options
Diffstat (limited to 'mod/src/main/resources/assets/dungeonsguide')
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 |