NumberSequence

Overview

Description

NumberSequence is a structure that defines a sequence of numerical key points. It is commonly utilized in animations, effects, and other time-based transitions to represent values that interpolate over time.

Properties

KeyPoints

An array containing all key points within the NumberSequence. Each key point defines a time and a value, where the sequence interpolates between these points.

Code Samples

local NumSequence = NumberSequence.new(1, 10)
local KeyPoints = NumSequence.KeyPoints

for _, keypoint in ipairs(KeyPoints) do
    print(keypoint.Time, keypoint.Value)
end

Constructors

new

Creates a new NumberSequence using a single value. All key points will have the same value.

Parameters

number InValue

The numerical value for the sequence.

Return

NumberSequence

A constructed `NumberSequence` containing the specified value as all key points.

Code Samples

local NumSequence = NumberSequence.new(5)

new

Creates a new NumberSequence using two values. A start and end key point will automatically be created.

Parameters

number InValue0

The value at the start of the sequence.

number InValue1

The value at the end of the sequence.

Return

NumberSequence

A constructed `NumberSequence` with the specified start and end values.

Code Samples

local NumSequence = NumberSequence.new(1, 10)

new

Creates a new NumberSequence using an array of key points. Each key point determines a specific value at a certain time.

Parameters

array InArrayValue

An array of `NumberSequenceKeyPoint` objects representing the desired sequence.

Return

NumberSequence

A constructed `NumberSequence` from the provided array of key points.

Code Samples

local Time1 = 0
local Time2 = 1

local KeyPoints = 
{
    NumberSequenceKeyPoint.new(Time1, 0), 
    NumberSequenceKeyPoint.new(Time2, 10) 
}
local NumSequence = NumberSequence.new(KeyPoints)

Methods

Last updated