Skip to content

Reimplementation of Roblox's tween service to open up customizability

License

Notifications You must be signed in to change notification settings

towerscripter1386/CustomTweenService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DO NOT USE TWEENINTERPOLATION.RBXM, THIS IS A LEGACY VERSION AND IT IS ONLY MEANT TO BE USED FOR BACKWARDS SUPPORT

CustomTweenService

Available types:

CFrame
Vector3
Color3
Vector2
UDim2
Rect
UDim
number

Class structures

All variables with _ are internal and should not be changed manually, hence no documentation provided. Types are copied directly from the Classes file

CustomTween definition:

export type CustomTween = {
	new:typeof(CustomTween_new);
	Play:typeof(CustomTween_Play);
	Pause:typeof(CustomTween_Pause);
	Cancel:typeof(CustomTween_Cancel);
	PrepareGC:typeof(CustomTween_PrepareGC);
	GetTweenFunc:typeof(CustomTween_GetTweenFunc);
	GetLerpFunc:typeof(CustomTween_GetLerpFunc);
	
	State:Enum.PlaybackState;
	Completed:RBXScriptSignal?;
	
	_enumToFunc:{{(t:number, b:number, c:number,as:number?,p:number?) -> number}};
	_stringToLerp:{[string]:<T>(self:T,goal:T,alpha:number) -> T};
	
	_event:BindableEvent?;
	_initValues:{[any]:any};
	_object:Instance|{[any]:any};
	_goal:{[any]:any};
	_customTweenInfo:CustomTweenInfo;
	_optimalValue:number;
	_tweenPercent:number;
	_tweenValue:number;
	_runTime:thread?;
	_func:(t:number, b:number, c:number,as:number?,p:number?) -> number;
	_runTimeFunc:typeof(CustomTween_RunTime);
}
Name Info
new Creates a new CustomTween

Arguments:
Name Type Optional?
self CustomTween No
object Instance or table No
goal table No
tweenInfo CustomTweenInfo Yes

Returns: CustomTween
Play Plays the tween

Arguments:
Name Type Optional?
self CustomTween No

Returns: void
Pause Pauses the tween, does not fire the Completed event

Arguments:
Name Type Optional?
self CustomTween No

Returns: void
Cancel Cancels the tween, resets it's internal variables and fires the Completed event

Arguments:
Name Type Optional?
self CustomTween No

Returns: void
PrepareGC Plays the tween

Arguments:
Name Type Optional?
self CustomTween No
Returns: void

CustomTweenInfo definition:

export type CustomTweenInfo = {
	new:typeof(CustomTweenInfo_new); 
	fromTweenInfo:typeof(CustomTweenInfo_new_fromTweenInfo);
	
	Direction:number;
	Style:number;
	Reverses:boolean;
	Count:number;
	Delay:number;
	Duration:number;
	Amplitude:number;
	Period:number;
	
	_robloxEnumToCustom:{
		[Enum.EasingStyle|Enum.EasingDirection]:number;
	};
}

About

Reimplementation of Roblox's tween service to open up customizability

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages