Skip to content

feat(roblox): add TweenInfo datatype#402

Open
pealz1 wants to merge 1 commit into
lune-org:mainfrom
pealz1:feat/tween-info-datatype
Open

feat(roblox): add TweenInfo datatype#402
pealz1 wants to merge 1 commit into
lune-org:mainfrom
pealz1:feat/tween-info-datatype

Conversation

@pealz1

@pealz1 pealz1 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Adds the TweenInfo datatype to the roblox standard library. It was the only commonly-used tween-related datatype missing, so roblox.TweenInfo currently returns nil.

What's included

  • TweenInfo.new(time?, easingStyle?, easingDirection?, repeatCount?, reverses?, delayTime?) with Roblox's defaults (Time = 1, EasingStyle = Quad, EasingDirection = Out, RepeatCount = 0, Reverses = false, DelayTime = 0).
  • Properties: Time, EasingStyle, EasingDirection, RepeatCount, Reverses, DelayTime.
  • Eq and ToString metamethods.
  • EasingStyle / EasingDirection arguments are validated against their Enum types, mirroring how Font validates FontWeight / FontStyle.

Implementation notes

TweenInfo is never stored on instances, so it has no rbx_dom_weak backing type. Like the enum singletons, it's therefore a standalone datatype and does not participate in DOM conversion (conversion.rs / extension.rs / attributes.rs are untouched). The two easing enums are stored as EnumItem rather than re-declared as Rust enums, keeping the surface small.

Testing

  • New tests/roblox/datatypes/TweenInfo.luau covering constructors, defaults, property round-trips, enum-type validation errors, equality, and tostring — registered in crates/lune/src/tests.rs.
  • cargo test -p lune roblox_datatype_tween_info passes.
  • cargo fmt clean; cargo clippy reports nothing new for the added code.
  • Changelog entry added under Unreleased.

Adds the TweenInfo datatype to the roblox standard library, matching
Roblox's constructor and property surface:

- TweenInfo.new(time?, easingStyle?, easingDirection?, repeatCount?, reverses?, delayTime?)
- Properties: Time, EasingStyle, EasingDirection, RepeatCount, Reverses, DelayTime
- Eq and tostring metamethods

EasingStyle/EasingDirection arguments are validated against their Enum types.
TweenInfo has no rbx_dom_weak backing (Roblox never stores it on instances), so
it is a standalone datatype with no DOM conversion. Includes a Luau test and a
changelog entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant