#Ui/Shaders
61 messages · Page 1 of 1 (latest)
by code
can you show the code?
I don't think you can change the position of nodes inside a VBoxContainer
so i eliminate this (button, "position:x", button.position.x -10, 0.2)?
I am trying to understand how they get on top of each other
nevermind
you can indeed change the position
although it is weird that you can
is something else
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)
so what positions do i put'
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
so i make like a new control?
but then it is gone
like i dont know what do i put in the shaders on the ui
like i need to make 1 vertex shader,1 fragment shader, 1 visual shader and 1 shader in code
but i always get it wrong
did you figure it out?
you need to add a ShaderMaterial to the node
and then assign the shader
okay makes sence
But im still not understanding shaders
hmm but wich shaders i put in this UI
that is my question i need to put four of them
is that a school work or something?
Is for University work
Its college
But the think is that i dont understand the shaders
don't you have a teacher that should be teaching that?
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...
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.