#Ui/Shaders

61 messages · Page 1 of 1 (latest)

severe thunder
#

how are you animating the buttons?

charred fog
#

by code

severe thunder
#

can you show the code?

charred fog
severe thunder
#

I don't think you can change the position of nodes inside a VBoxContainer

charred fog
#

so i eliminate this (button, "position:x", button.position.x -10, 0.2)?

severe thunder
#

I am trying to understand how they get on top of each other

charred fog
#

it stay like this and the menus start jumping to the left

severe thunder
#

nevermind

#

you can indeed change the position

#

although it is weird that you can

#

is something else

charred fog
#

you want me to put the whole code

#

i only put half of it

#

extends Control

var tween: Tween

@onready var button: Button = %Button
@onready var button_2: Button = %Button2
@onready var button_3: Button = %Button3

@onready var label: Label = %Label

@onready var logo: TextureRect = %Logo

@onready var snow_particles: GPUParticles2D = %Snow_particles
@onready var notas_particles: GPUParticles2D = %Notas_Particles

@onready var label_1: Label = %Label1

func _ready() -> void:
setup()
animate()

func setup() -> void:
button.modulate.a = 0.0
button_2.modulate.a = 0.0
button_3.modulate.a = 0.0

#

func animate() -> void:
tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_CUBIC)

tween.tween_interval(1.0)

tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_CUBIC)
tween.tween_interval(2)
tween.tween_property(logo, "self_modulate:a", 1.0,0.75).set_delay(2)
tween.parallel().tween_property(label, "scale", Vector2.ONE, 0.4)\
    .set_trans(Tween.TRANS_ELASTIC).set_ease(Tween.EASE_OUT)
    
    
    
tween.tween_callback(snow_particles.restart)
tween.tween_callback(notas_particles.restart)


tween.tween_property(label, "self_modulate:a", 1.0, 1.2)

tween.tween_interval(0.1)
tween.tween_property(button, "modulate:a", 1.0,0.25)
tween.parallel().tween_property(button, "position:y", button.position.y, + 0.50)\
    .from(button.position.y +100)
tween.tween_property(button_2, "modulate:a", 1.0,0.25)
tween.parallel().tween_property(button_3, "position:y", button_3.position.y, 0.25)\
    .from(button_3.position.y +100)
tween.tween_property(button_3, "modulate:a", 1.0,0.25)
tween.parallel().tween_property(button_2, "position:y", button_2.position.y, 1.00)\
    .from(button_2.position.y +100)
    
tween.tween_callback(start_button_loop)
#

func start_button_loop() -> void:
var button_tween := create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_CUBIC)
button_tween.set_loops()

button_tween.tween_property(button, "position:x", button.position.x -10, 0.2)
button_tween.tween_property(button, "position:x", button.position.x, 0.2)

button_tween.tween_property(button_2, "position:x", button.position.x - 10, 0.2)
button_tween.tween_property(button_2, "position:x", button.position.x, 0.2)

button_tween.tween_property(button_3, "position:x", button.position.x - 10, 0.2)
button_tween.tween_property(button_3, "position:x", button.position.x, 0.2)
charred fog
severe thunder
#

it seems the VBox is the problem

#

I am trying to find out how and why

#

because if I take buttons out of it they animate fine

#

if you print the button position.y they are all at 0

#

even though they are not

#

so yeah, Vbox is the culprit.

#

what you can do is create a container for each button that holds the place in the VBox

#

then animate the button

#

something like this

charred fog
#

so i make like a new control?

charred fog
charred fog
#

i solved it

#

But i have a problem on the shaders

charred fog
#

like i need to make 1 vertex shader,1 fragment shader, 1 visual shader and 1 shader in code

charred fog
#

but i always get it wrong

severe thunder
#

did you figure it out?

#

you need to add a ShaderMaterial to the node

#

and then assign the shader

charred fog
#

okay makes sence

charred fog
#

But im still not understanding shaders

severe thunder
#

they are not simple

#

I don't know much about it either

charred fog
#

hmm but wich shaders i put in this UI

#

that is my question i need to put four of them

severe thunder
#

is that a school work or something?

charred fog
#

Its college

#

But the think is that i dont understand the shaders

severe thunder
#

don't you have a teacher that should be teaching that?

charred fog
#

Yes

#

but at the same time he says he wont teach me

unkempt jetty
# charred fog But the think is that i dont understand the shaders

Shaders are an entire beast on their own , I recommend watching tutorials about shaders here is intro tutorial to shaders https://www.youtube.com/watch?v=BRPy8n2Ayc8

Basics of shaders for Godot 4.
Feel free to ask questions in the comments I will answer them all!

My Games:

Moving In: https://store.steampowered.com/app/2307660/Moving_In/
Mirrorama: https://store.steampowered.com/app/1845050/Mirrorama/?utm_source=youtube

Discord: https://discord.com/invite/qv8ECWuXxm

All my socials:
Linktree: https://linkt...

▶ Play video
#

Not everyone is a shader programmer so is gonna be hard to find an answer to your question, also, probably the reason your teacher refuses to teach you that is because he doesn't know shader programming.

#

@charred fog also there is a channel dedicated to shaders #shaders-and-vfx

#

maybe you'll find better luck there.

charred fog
#

okay

#

but is an open chat

#

do i ask help there?

unkempt jetty
#

Yes. try to be as specific as possible what do you want your shaders to do.

#

ask for reasources you can read and so on.