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

Getting Started

Ryan Luu edited this page Dec 21, 2023 · 5 revisions

This page will cover installation and basic usage including code samples of Shime. For more information about Shime, you can read the Documentation.

Installation

Shime is simple and straightforward, you will need the require Shime's module script as a variable and then you can use constructors such as Shime.new() to create a new Shimmer object. Below are two methods to install Shime.

Install from Roblox

Warning This installation method will not allow for automatic updates including security updates. It is recommended to use the Require from Roblox method. Only use this method if you are planning to use a modified version of Shime.

  1. Get the Shime module from the Creator Marketplace.

CreatorMarketplace

  1. Open Roblox Studio and create a new place or open an existing place.

  2. Open or locate the Toolbox.

View Tab Toolbox

  1. Open your Inventory from the Toolbox.

Inventory Tab

  1. Search for Shimmer Module created by WinnersTakesAll and click on it.

Toolbox

  1. Insert Shimmer Module into the Explorer and drag into ReplicatedStorage.

Explorer

Install from GitHub

Warning This installation method will not allow for automatic updates including security updates. It is recommended to use the Require from Roblox method. Only use this method if you are planning to use a modified version of Shime.

You can install Shime from GitHub, this is intended if you want to use a modified version of Shime.

  1. Download the Shime.rbxm file from Releases.

GitHubRelease

  1. Open Roblox Studio and create a new place or open an existing place.

  2. Go to the Explorer and right click on ReplicatedStorage and click on Insert from file....

InsertFromFile

  1. Select the Shime.rbxm you downloaded from GitHub and click Open.

UploadFile

  1. Require the Shime module in your script like below when you want to use Shime.
local Shime = require(game.ReplicatedStorage.Shime)

Usage

The below code samples will show you how to use Shime and it's constructors, methods, and functions. To learn more about Shime, you can read the Documentation.

The examples below expect the script.Parent to be a GuiObject and that you have the Shime module in ReplicatedStorage, to learn about how to add the module to ReplicatedStorage go to Installation > Download from GitHub & Install in Studio. If you are using Shime from Roblox, you will need to change the require line to local Shime = require(1234567890) where 1234567890 is the ID of the Shime module.

Creating a Shimmer

To create a Shimmer, you need to create a new Shimmer object. You can do this by calling the Shime module like a function. The below script will create a new Shimmer object and store it in a variable called shimmer and add it to the script.Parent then play it using Shimmer:Play().

-- Require the Shime module
local Shime = require(game.ReplicatedStorage.Shime)

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

Creating a Shimmer with a Custom Animation

Shime allows you to create a Shimmer with a custom animation using the Shimmer.new() methods and specifying the parameters which are based closely off the TweenBase class. The below script will create a new Shimmer object and store it in a variable called shimmer and add it to the script.Parent then play it using Shimmer:Play(). The Shimmer will use a custom animation that will be played when the Shimmer is played.

-- Require the Shime module
local Shime = require(game.ReplicatedStorage.Shime)

local time = 1 -- Time for shimmer animation
local style = Enum.EasingStyle.Linear -- Easing style for shimmer animation
local direction = Enum.EasingDirection.InOut -- Easing direction for easing style
local repeatCount = -1 -- Repeat amount for shimmer (negative number means infinite)
local reverse = false -- Reverse direction of shimmer when it reaches the end
local delayTime = 0 -- Delay between each shimmer

-- Create a new Shimmer and play it
local shimmer = Shime.new(script.Parent, time, style, direction, repeatCount, reverse, delayTime)
shimmer:Play()

Pausing & Stopping a Shimmer

To pause a Shimmer, you need to call the Shimmer.Pause() function which can be paused again to toggle the playback state. The below script will create a new Shimmer object and store it in a variable called shimmer and add it to the script.Parent then play it. When the mouse enters the GuiObject the Shimmer will be paused using Shimmer.Pause and when the mouse leaves the GuiObject the Shimmer will be stopped.

-- Require the Shime module
local Shime = require(game.ReplicatedStorage.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)

Reading Shimmer Properties

Shimmer has a few properties that you can use to get information about the Shimmer mostly related to the Shimmer's state. The below script will create a new Shimmer object and store it in a variable called shimmer and add it to the script.Parent then play it. Every 1 second the shimmer is paused then played again. The PlaybackState property is then printed to the output.

-- Require the Shime module
local Shime = require(game.ReplicatedStorage.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.PlaybackState == Enum.PlaybackState.Playing then
		-- Pause the shimmer and print PlaybackState
		shimmer:Pause()
		print("shimmer.PlaybackState: " .. tostring(shimmer.PlaybackState))
	elseif shimmer.PlaybackState == Enum.PlaybackState.== Enum.PlaybackState.Playing then
		-- Play the shimmer and print PlaybackState
		shimmer:Play()
		print("shimmer.PlaybackState: " .. tostring(shimmer.PlaybackState))
	end
end

Creating a Shimmer with a Custom Frame and Gradient

Shimmer can be customized using the Shimmer.GetFrame() and Shimmer.GetGradient() functions. The below script will create a new Shimmer object and store it in a variable called shimmer and add it to the script.Parent then play it. The Shimmer will use a custom frame and gradient.

-- Require the Shime module
local Shime = require(game.ReplicatedStorage.Shime)

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

-- Get the Shimmer's frame and set it's properties
local frame = shimmer:GetFrame()
frame.Size = UDim2.new(0.5, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.AnchorPoint = Vector2.new(0, 0)

-- Get the Shimmer's gradient and set it's properties
local gradient = shimmer:GetGradient()
gradient.Rotation = 90
gradient.Transparency = NumberSequence.new({
	NumberSequenceKeypoint.new(0, 0),
	NumberSequenceKeypoint.new(0.5, 0.5),
	NumberSequenceKeypoint.new(1, 0)
})