Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Documentation

Ryan edited this page Mar 24, 2023 · 10 revisions

Documentation for the Shime module. Shime is a class that allows you to create a shimmer effect on any GuiObject on Roblox. Based off of Roblox's Shimmer module from CoreGui.

Summary

Constructors

new(parent: GuiObject)
Returns a table containing Shimmer's metatable. Shimmers using default parameters.
new(parent: GuiObject, time: number?, style: EasingStyle, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delay: number?)
Returns a table containing Shimmer's metatable. Shimmers using specified parameters.

Properties

Property Details
IsCompleted: boolean This read-only property will return true when the Shimmer has completed.
IsPaused: boolean This read-only property will return true when the Shimmer is not playing.
IsPlaying: boolean This read-only property will return true when the Shimmer is playing.

Methods

Stop(): void
The Stop function halts Shimmer. If Shimmer:Play() is called again the Shimmer will resume interpolating towards their destination but take the full length of the time to do so.
Pause(): void
The Pause function halts Shimmer. If you call Shimmer:Play() again, the shimmer resumes playback from the moment it was paused.
Play(): void
The Play function starts Shimmer. Note that if a shimmer has already begun calling Play will have no effect unless the shimmer has finished or has been stopped (either by Shimmer:Stop() or Shimmer:Pause()).

Constructors

new

Creates a new Shimmer from the provided parameters.

Parameters

Parameter Details
parent: GuiObject
time: number Default Value: "1"
style: EasingStyle Default Value: "EasingStyle.Linear"
direction: EasingDirection Default Value: "EasingDirection.In"
repeatCount: number Default Value: "-1"
reverses: boolean Default Value: "false"
delay: number Default Value: "0"

Properties

IsCompleted

This read-only property will return true when the Shimmer has completed.

This property can only be true when Shimmer.IsPlaying is false.

As IsCompleted is read only it can not be used to stop the Shimmer, Shimmer.Stop() must be used instead.

Code Samples

This code sample contains demonstrates when the Shimmer.IsPlaying and Shimmer.IsPaused properties will be true or false.

A shimmer is created and played. Every 1 second the shimmer is paused then played again. The IsPlaying and IsPaused properties are then printed to the output.

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Loop shimmers play and pause every 1 second
while true do
	task.wait(1)
	if shimmer.IsPlaying then
		-- Pause the shimmer and print IsPaused
		shimmer:Pause()
		print("shimmer.IsPaused: " .. tostring(shimmer.IsPaused))
	elseif shimmer.IsPaused then
		-- Play the shimmer and print IsPlaying
		shimmer:Play()
		print("shimmer.IsPlaying: " .. tostring(shimmer.IsPlaying))
	end
end

IsPaused

This read-only property will return true when the Shimmer is not playing.

This property can only be true when Shimmer.IsPlaying is false.

As IsPaused is read only it can not be used to pause the Shimmer, Shimmer.Pause() must be used instead.

Code Samples

This code sample contains demonstrates when the Shimmer.IsPlaying and Shimmer.IsPaused properties will be true or false.

A shimmer is created and played. Every 1 second the shimmer is paused then played again. The IsPlaying and IsPaused properties are then printed to the output.

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Loop shimmers play and pause every 1 second
while true do
	task.wait(1)
	if shimmer.IsPlaying then
		-- Pause the shimmer and print IsPaused
		shimmer:Pause()
		print("shimmer.IsPaused: " .. tostring(shimmer.IsPaused))
	elseif shimmer.IsPaused then
		-- Play the shimmer and print IsPlaying
		shimmer:Play()
		print("shimmer.IsPlaying: " .. tostring(shimmer.IsPlaying))
	end
end

IsPlaying

This read-only property will return true when the Shimmer is playing.

This property can only be true when Shimmer.IsPaused is false.

As IsPlaying is read only it can not be used to play the Shimmer, Shimmer.Play() must be used instead.

Code Samples

This code sample contains demonstrates when the Shimmer.IsPlaying and Shimmer.IsPaused properties will be true or false.

A shimmer is created and played. Every 1 second the shimmer is paused then played again. The IsPlaying and IsPaused properties are then printed to the output.

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Loop shimmers play and pause every 1 second
while true do
	task.wait(1)
	if shimmer.IsPlaying then
		-- Pause the shimmer and print IsPaused
		shimmer:Pause()
		print("shimmer.IsPaused: " .. tostring(shimmer.IsPaused))
	elseif shimmer.IsPaused then
		-- Play the shimmer and print IsPlaying
		shimmer:Play()
		print("shimmer.IsPlaying: " .. tostring(shimmer.IsPlaying))
	end
end

Methods

Stop

Stops the Shimmer. Sets Shimmer.IsPlaying to false.

Returns

void

Code Samples

This sample gives a simple demonstration of what each of the Shimmer functions (Shimmer.Play, Shimmer.Stop and Shimmer.Pause).

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Pause the Shimmer when the mouse enters the GuiObject
script.Parent.MouseEnter:Connect(function()
	shimmer:Pause()
end)

-- Stop the Shimmer when the mouse leaves the GuiObject
script.Parent.MouseButton1Click:Connect(function()
	shimmer:Stop()
end)

Pause

Pauses the Shimmer. Sets Shimmer.IsPlaying to false.

Returns

void

Code Samples

This sample gives a simple demonstration of what each of the Shimmer functions (Shimmer.Play, Shimmer.Stop and Shimmer.Pause).

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Pause the Shimmer when the mouse enters the GuiObject
script.Parent.MouseEnter:Connect(function()
	shimmer:Pause()
end)

-- Stop the Shimmer when the mouse leaves the GuiObject
script.Parent.MouseButton1Click:Connect(function()
	shimmer:Stop()
end)

Play

Plays the Shimmer. Sets Shimmer.IsPlaying to true.

Returns

void

Code Samples

This sample gives a simple demonstration of what each of the Shimmer functions (Shimmer.Play, Shimmer.Stop and Shimmer.Pause).

-- Require the Shime module
local Shime = require(script.Parent.Shime)

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent)
shimmer:Play()

-- Pause the Shimmer when the mouse enters the GuiObject
script.Parent.MouseEnter:Connect(function()
	shimmer:Pause()
end)

-- Stop the Shimmer when the mouse leaves the GuiObject
script.Parent.MouseButton1Click:Connect(function()
	shimmer:Stop()
end)