TweenInfoデータ型
データ型日本語解説あり
ひとことで言うと
TweenServiceで、変化にかける時間・変化のしかた・くりかえしなどを決めるデータ型です。
公式の説明(英語):Stores parameters for Class.Tween|Tweens.
使用例
Script置く場所:動かしたいパーツの中
local TweenService = game:GetService("TweenService")
local platform = script.Parent :: BasePart
platform.Anchored = true
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
local goal = { Position = platform.Position + Vector3.new(0, 0, 20) }
local tween = TweenService:Create(platform, tweenInfo, goal)
tween:Play()スクリプトは、Luauの型チェック(luau-lsp)で確認しています。
コンストラクター(作り方)(1)
| 名前と書き方 | 説明 |
|---|---|
newTweenInfo.new(time: number, easingStyle: EasingStyle, easingDirection: EasingDirection, repeatCount: number, reverses: bool, delayTime: number) | 時間・変化のしかた(EasingStyle)・方向・くりかえしの回数・行って戻るか・待ち時間を指定して作ります。Creates a new TweenInfo from the provided parameters. |
プロパティ(6)
| 名前と書き方 | 説明 |
|---|---|
EasingDirectionTweenInfo.EasingDirection: EasingDirection | The direction in which the tween executes. |
TimeTweenInfo.Time: number | Duration of the tween, in seconds. |
DelayTimeTweenInfo.DelayTime: number | Time of delay until the tween begins, in seconds. |
RepeatCountTweenInfo.RepeatCount: number | Number of times the tween repeats. |
EasingStyleTweenInfo.EasingStyle: EasingStyle | The style in which the tween executes. |
ReversesTweenInfo.Reverses: bool | Whether or not the tween interpolates in reverse tween once the initial tween completes. |
TweenInfoを使う記事
英語の説明とメンバーの一覧は、Roblox Creator Documentation(TweenInfo)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。