강좌모음

인트로 화면 Fade out 시키기 - tweening 이용

작성자
nobakee
작성일
2022-08-15 21:40
조회
482

TweenService를 이용해서 인트로 화면을 fade out 시키는 예제입니다.

IntroFade Script

print("Fade Intro")
local introFrame = script.Parent

wait(2)

local tweenService = game:GetService("TweenService")

local timeToFade = 5
local tweenInfo = TweenInfo.new(timeToFade)

local goalFrame = {}
goalFrame.BackgroundTransparency = 1
local tweenFrame = tweenService:Create(introFrame, tweenInfo, goalFrame)
tweenFrame:Play()

local goalText = {}
goalText.TextTransparency = 1
local tweenText = tweenService:Create(introFrame.TextLabel, tweenInfo, goalText)
tweenText:Play()

wait(timeToFade)
introFrame:Destroy()
전체 0