# TweenInfo

## Overview

A configuration object that defines the behavior of a tween animation. It is used when TweenService:Create() is called to control detailed behaviors of tween including duration of property change, type of interpolation, and loop settings.

The property values of TweenInfo cannot be modified after creation. If you need a different setting, a new TweenInfo needs to be created.

## Constructors

### new

Creates a new TweenInfo object including the configuration value needed to execute tween behaviors using passed factors.

The created TweenInfo is used later when tween is configured in TweenService.

#### Parameters

| `number` InTime                          | The time in seconds that the tween animation takes to progress from start to finish. The higher the value, the slower the change.                                           |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Enum.EasingStyle` InEasingStyle         | Determines in which curve tween will change over time. With this, you can make it smooth or accentuate a certain motion.                                                    |
| `Enum.EasingDirection` InEasingDirection | Sets whether acceleration or deceleration is applied at the start or end point of the tween.                                                                                |
| `number` InRepeatCount                   | The number of loops to play the tween. A value of -1 means an infinite loop.                                                                                                |
| `boolean` InReverses                     | Specifies whether or not to play the tween repeatedly. When enabled, the tween reverses direction after reaching its target value and plays back toward its starting point. |
| `number` InDelayTime                     | The time in seconds to wait before the tween starts. It is useful for sequencing multiple animations.                                                                       |

#### Return

| `TweenInfo` | The created TweenInfo object. |
| ----------- | ----------------------------- |

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)
```

## Properties

### DelayTime

`number`

A property that specifies the waiting time before the tween is executed.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.DelayTime)
```

### EasingDirection

`Enum.EasingDirection`

A property that determines whether acceleration or deceleration is applied at the start or end point of the tween.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.EasingDirection)
```

### EasingStyle

`Enum.EasingStyle`

A property that determines the curve shape by which the tween changes over time.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.EasingStyle)
```

### RepeatCount

`number`

A property that specifies the number of loops to play a tween animation. -1 means an infinite loop.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.RepeatCount)
```

### Reverses

`boolean`

A property that determines whether to play the tween backward during repetition after reaching its target value.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.Reverses)
```

### Time

`number`

The time in seconds that the tween animation takes to progress from start to finish.

#### Code Samples

```lua
local TweenInfoData = TweenInfo.new(
    2,                         -- Time
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- Number of repetitions (-1 for infinite)
    false,                     -- Reverses
    0                          -- DelayTime
)

print(TweenInfoData.Time)
```

## Methods

## Events

## See also


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/datatype/tweeninfo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
