rojo/.cursor/rules/roblox/reference/engine/classes/FloatCurve.yaml
2026-02-02 12:08:47 -06:00

214 lines
6 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: FloatCurve
type: class
memory_category: Instances
summary: |
A sorted list of time-value pairs that define a curve. Used to animate a
single numerical value.
description: |
An instance representing a 1D float curve encoded via a sorted list of
`Datatype.FloatCurveKey|FloatCurveKeys`. The shape of the interpolation curve
between two keys is determined by the `Datatype.FloatCurveKey.Interpolation`
type.
code_samples: []
inherits:
- Instance
descendants: []
tags: []
deprecation_message: ''
properties:
- name: FloatCurve.Length
summary: |
Number of keys in the float curve.
description: |
Number of keys in the float curve.
code_samples: []
type: int
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: false
can_save: true
capabilities:
- Basic
methods:
- name: FloatCurve:GetKeyAtIndex
summary: |
Returns a copy of a key at a given index.
description: |
Returns a copy of a key at a given index.
code_samples: []
parameters:
- name: index
type: int
default:
summary: ''
returns:
- type: FloatCurveKey
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:GetKeyIndicesAtTime
summary: |
Returns the index of the last and first key of a period of time.
description: |
The first item in the returned array is the index of the last key with
time less than or equal to `time` (or the lesser of either 1 or the curve
length if no key was found). The second item in the returned array is the
index of the first key with time greater than or equal to `time` (or the
curve length if no key was found satisfying the inequality).
code_samples: []
parameters:
- name: time
type: float
default:
summary: ''
returns:
- type: Array
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:GetKeys
summary: |
Returns a copy of all the keys in the FloatCurve as a Luau array of
`Datatype.FloatCurveKey|FloatCurveKeys`.
description: |
Returns a copy of all the keys in the FloatCurve as a Luau array of
`Datatype.FloatCurveKey|FloatCurveKeys`.
code_samples: []
parameters: []
returns:
- type: Array
summary: |
Array of `Datatype.FloatCurveKey|FloatCurveKeys`.
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:GetValueAtTime
summary: |
Samples the float curve at a given time passed as argument.
description: |
Samples the float curve at a given time passed as argument.
code_samples: []
parameters:
- name: time
type: float
default:
summary: |
Time at which to sample the curve.
returns:
- type: float?
summary: |
Value of the curve at the requested `time`.
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:InsertKey
summary: |
Adds the key passed as an argument to this curve. If a key at the same
time is found, it will be replaced.
description: |
Adds the key passed as an argument to this curve. If a key at the same
time is found, it will be replaced. In the returned array, the first value
is `true` if a key was added or `false` if a previous key was replaced;
the second value is the index at which the marker was added.
code_samples: []
parameters:
- name: key
type: FloatCurveKey
default:
summary: |
`Datatype.FloatCurveKey` to insert.
returns:
- type: Array
summary: |
(see description) .
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:RemoveKeyAtIndex
summary: |
Removes a given number of keys starting from a given index.
description: |
Removes a given number (`count`) of keys starting from the `startingIndex`
index and returns the number of keys that were removed.
code_samples: []
parameters:
- name: startingIndex
type: int
default:
summary: |
Starting index from which to remove keys.
- name: count
type: int
default: 1
summary: |
Number of keys to remove.
returns:
- type: int
summary: |
Number of keys removed.
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
- name: FloatCurve:SetKeys
summary: |
Resets this curve's keys using the `Datatype.FloatCurveKey` array passed
as an argument.
description: |
Resets this curve's keys using the `Datatype.FloatCurveKey` array passed
as an argument. Keys in the `keys` array are sorted in ascending time
order before insertion, and keys at duplicated times are removed in a
stable manner.
Returns the number of keys actually inserted. Keys previously stored in
this curve are removed before the keys passed as arguments are added.
code_samples: []
parameters:
- name: keys
type: Array
default:
summary: |
Array of `Datatype.FloatCurveKey|FloatCurveKeys`.
returns:
- type: int
summary: |
Number of keys inserted.
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Basic
events: []
callbacks: []