Tween

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

Tween 개체는 인터폴레이션의 재생을 제어합니다.만들고 구성하는 TweenTweenService:Create() 함수로 수행됩니다; Instance.new() 이 특정 개체에 사용할 수 없습니다.

십대가 생성된 후에 십대 구성에 액세스할 수는 있지만 수정할 수는 없습니다.인터폴레이션에 새로운 목표가 필요한 경우 새로운 Tween 가 생성되어야 합니다.

또한 여러 십대가 동시에 동일한 개체에서 재생될 수 있지만 동일한 속성을 인터폴레이션해서는 안됩니다.두 청소년이 동일한 속성을 수정하려고 시도하면 초기 청소년이 취소되고 가장 최근의 청소년에 의해 덮어쓰입니다.

코드 샘플

In this example a Tween is created to animate the position and color of a Part. Because the position and color are part of the same tween, they will change at the exact same rate and will reach their goal at the same time.

Tween Creation

local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.new(1, 0, 0)
part.Anchored = true
part.Parent = game.Workspace
local goal = {}
goal.Position = Vector3.new(10, 10, 0)
goal.Color = Color3.new(0, 1, 0)
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()

요약

속성

  • 읽기 전용
    복제되지 않음
    병렬 읽기

    tween에 의해 인터폴레이션되는 속성을 가리키는 읽기 전용 속성 Instance

  • 읽기 전용
    복제되지 않음
    병렬 읽기

    Tween의 인터폴레이션 방법에 대한 정보를 포함하는 읽기 전용 속성.

속성TweenBase에서 상속되었습니다

메서드

메서드TweenBase에서 상속되었습니다
  • Cancel():()

    재생을 중지하고 청소년 변수를 재설정합니다.그런 다음 TweenBase:Play()를 호출하면 청소년의 목적지로 이동하는 속성이 재개되지만, 그렇게 하기 위해 애니메이션의 전체 길이를 사용합니다.

  • Pause():()

    청소년의 재생을 중지합니다.진행률 변수를 재설정하지 않으므로, TweenBase:Play()를 호출하면 청소년의 재생이 일시 중지된 순간부터 재개됩니다.

  • Play():()

    청소년의 재생을 시작합니다.재생이 이미 시작되었으면 Play()를 호출하더라도 청소년이 완료되거나 중지되지 않으면 효과가 없습니다(TweenBase:Cancel() 또는 TweenBase:Pause()에 의해).

이벤트

이벤트TweenBase에서 상속되었습니다

속성

Instance

읽기 전용
복제되지 않음
병렬 읽기

이 속성의 Tween (읽기 전용) 포인트는 속성이 인터폴레이션되는 Instance 의 지점을 가리킵니다.

코드 샘플

This code sample includes a simple function that will return true if the instance of a tween is a Part.

Tween Instance

local TweenService = game:GetService("TweenService")
local function isInstanceAPart(tween)
local instance = tween.Instance
return instance:IsA("BasePart")
end
local tweenInfo = TweenInfo.new()
local instance = Instance.new("Part")
local tween = TweenService:Create(instance, tweenInfo, {
Transparency = 1,
})
print(isInstanceAPart(tween))

TweenInfo

읽기 전용
복제되지 않음
병렬 읽기

Tween 의 인터폴레이션 방법에 대한 정보를 포함하는 읽기 전용 속성, TweenInfo 데이터 입력사용하여.

코드 샘플

An example of the range of different interpolation effects that can be used in Tweens.

TweenInfo Examples

-- A TweenInfo with all default parameters
TweenInfo.new()
-- A TweenInfo with its time set to 0.5 seconds.
TweenInfo.new(0.5)
-- A TweenInfo with its easing style set to Back.
TweenInfo.new(0.5, Enum.EasingStyle.Back)
-- A TweenInfo with its easing direction set to In.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In)
-- A TweenInfo that repeats itself 4 times.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4)
-- A TweenInfo that reverses its interpolation after reaching its goal.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4, true)
-- A TweenInfo that loops indefinitely.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, -1, true)
-- A TweenInfo with a delay of 1 second between each interpolation.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4, true, 1)

메서드

이벤트