Empty
Empty
Empty
TweenService es un servicio en Roblox que te permite crear animaciones suaves para elementos GUI, partes y otros objetos. Se utiliza para interpolar las propiedades de un objeto de un estado a otro durante un tiempo especificado.
Tween | Un tween es una animación que interpola las propiedades de un objeto desde un estado inicial hasta un estado final. |
TweenInfo | Esto define los parámetros del tween, como duración, estilo de easing, dirección de easing y repetición. |
Estilos y Direcciones de Easing | Los estilos de easing definen la función matemática utilizada para interpolar entre los valores de inicio y fin del tween. Las direcciones de easing definen cómo progresa el tween en relación con los valores de inicio y fin. |
Objetos Tweenables
Empty
Empty
Empty
Position | Mover partes/modelos a una nueva ubicación. |
Size | Cambiar las dimensiones de partes/modelos. |
Orientation | Rotar partes/modelos. |
Transparency | Ajustar el nivel de transparencia de partes/modelos. |
Color | Cambiar el color de partes/modelos. |
Empty
Empty
Empty
Position | Mover partes/modelos a una nueva ubicación. |
Size | Cambiar las dimensiones de partes/modelos. |
BackgroundColor3 | Cambiar el color de fondo de los elementos GUI. |
Transparency | Ajustar el nivel de transparencia de partes/modelos. |
Empty
Empty
Empty
Brightness | Ajustar el brillo de una fuente de luz. |
Color | Cambiar el color de partes/modelos. |
Range | Cambiar el alcance de una fuente de luz. |
Empty
Empty
Empty
CFrame | Mover o rotar la cámara. |
Empty
Empty
Empty
Volume | Ajustar el volumen de un sonido. |
PlaybackSpeed | Cambiar la velocidad de reproducción de un sonido. |
Ejemplo de TweenService
Tweening de Posición
local TweenService = game:GetService("TweenService")
-- Define TweenInfo
local tweenInfo = TweenInfo.new(
2, -- Time (seconds)
Enum.EasingStyle.Quad, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Repeat count (0 means no repeat)
false, -- Reverses (tween goes back and forth)
0 -- Delay time (seconds)
)
local part = script.Parent
part.Position = Vector3.new(0, 2.5, 0)
part.Anchored = true
part.Parent = workspace
-- Define the end state of the properties you want to tween
local goal = {}
goal.Position = Vector3.new(10, 5, 0)
-- Create the tween
local tween = TweenService:Create(part, tweenInfo, goal)
-- Play the tween
tween:Play()
Roblox Studio
Tweening de Elementos GUI
local TweenService = game:GetService("TweenService")
-- Define TweenInfo
local tweenInfo = TweenInfo.new(
2, -- Time (seconds)
Enum.EasingStyle.Quad, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Repeat count (0 means no repeat)
false, -- Reverses (tween goes back and forth)
0 -- Delay time (seconds)
)
local part = script.Parent
part.Position = Vector3.new(0, 2.5, 0)
part.Anchored = true
part.Parent = workspace
-- Define the end state of the properties you want to tween
local goal = {}
goal.Position = Vector3.new(10, 5, 0)
-- Create the tween
local tween = TweenService:Create(part, tweenInfo, goal)
-- Play the tween
tween:Play()
Roblox Studio
Tweening de Propiedades de Luz
local TweenService = game:GetService("TweenService")
-- Define TweenInfo
local tweenInfo = TweenInfo.new(
2, -- Time (seconds)
Enum.EasingStyle.Quad, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Repeat count (0 means no repeat)
false, -- Reverses (tween goes back and forth)
0 -- Delay time (seconds)
)
local part = script.Parent
part.Position = Vector3.new(0, 2.5, 0)
part.Anchored = true
part.Parent = workspace
-- Define the end state of the properties you want to tween
local goal = {}
goal.Position = Vector3.new(10, 5, 0)
-- Create the tween
local tween = TweenService:Create(part, tweenInfo, goal)
-- Play the tween
tween:Play()
Roblox Studio
Estilos de Easing
Empty
Empty
Empty
Linear | Se mueve a una velocidad constante de inicio a fin. |
Sine | Usa una onda sinusoidal para un movimiento suave y periódico. |
Back | Sobrepasa el valor final antes de regresar. |
Quad | Acelera rápidamente y luego desacelera. |
Cubic | Similar a Quad, pero con una aceleración y desaceleración más fuertes. |
Quart | Incluso más fuerte aceleración y desaceleración que Cubic. |
Quint | La aceleración y desaceleración más fuertes. |
Bounce | Imita un efecto de rebote al final. |
Elastic | Se mueve más allá del valor final de una manera elástica. |
Exponential | Comienza lentamente y acelera exponencialmente. |
Empty
Empty
Empty
In | El tween comienza lentamente y acelera hacia el final. |
Out | El tween comienza rápidamente y desacelera hacia el final. |
InOut | Combina tanto 'In' como 'Out', comenzando lentamente, acelerando en el medio y desacelerando nuevamente hacia el final. |
Si encuentras útil este tutorial y deseas apoyar mi trabajo, considera invitarme a un café.
¡Muchas gracias por tu apoyo!
Invítame a un café