Page 1 of 1

Animating Outlines

Posted: Wed Jul 06, 2022 1:19 pm
by Akhilles
Hey there everyone!

Hope you are all having a great day :)

I was wondering if it was possible to create a shake effect for the outlines in the main menu text.

Let me show you what I mean.

Here is the code:

style navigation_button_text:
properties gui.button_text_properties("navigation_button")
outlines [(absolute(1), "#99370C", absolute(3), absolute(0))]
xalign 0.5

I was wondering if I can make that outlines wiggle or shake around.

Thank you!

Re: Animating Outlines

Posted: Wed Jul 06, 2022 2:14 pm
by Ocelot
I would just create 2 text displayables one above the other. One would have transparent outlines, other would have coth text and outlines same color. Bottom (outline) displayable will have shake transform applied to it.

Re: Animating Outlines

Posted: Wed Jul 06, 2022 4:23 pm
by Akhilles
Thanks for the tip.

I'm fairly new to this and I'm trying to modify the main menu. So do I simply use:

style navigation_button_text:
properties gui.button_text_properties("navigation_button")
outlines [(absolute(1), , absolute(3), absolute(0))]
xalign 0.5

style navigation_button_text:
properties gui.button_text_properties("navigation_button")
outlines [(absolute(1), "#99370C", absolute(3), absolute(0))]

init:
transform my_shake:
linear 0.1 xoffset -2 yoffset 2
linear 0.1 xoffset 3 yoffset -3
linear 0.1 xoffset 2 yoffset -2
linear 0.1 xoffset -3 yoffset 3
linear 0.1 xoffset 0 yoffset 0
repeat

add my_shake

xalign 0.5

I'm probably getting this all wrong in my head. Let me know what I should be changing.
Ocelot wrote:
Wed Jul 06, 2022 2:14 pm
I would just create 2 text displayables one above the other. One would have transparent outlines, other would have coth text and outlines same color. Bottom (outline) displayable will have shake transform applied to it.