Git Product home page Git Product logo

Comments (5)

RyanLua avatar RyanLua commented on July 3, 2024

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

Shime aims to be as familiar and easy to use as possible so it would make sense to borrow TweenInfo table, which is very much in scope of Shime.

Currently as it stands if I do change the constructor, it would break backwards compatibility with the previous, including LTS releases of Shime.

from shime.

 avatar commented on July 3, 2024

Yeah that is better ;)

For now I gotta close this

I found how to fix this

function Shime.new(parent: GuiObject, tweenInfo: TweenInfo?)
	tweenInfo = tweenInfo or TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false, 0)

	local self = setmetatable({}, Shime)

	-- Create the shimmer frame and animation
	local shimmer = createShimmer(parent)
	self._frame = shimmer
	self._gradient = shimmer:FindFirstChildOfClass("UIGradient")
	self._corner = shimmer:FindFirstChildOfClass("UICorner")

	-- Create the tween
	self._tween = TweenService:Create(
		self._gradient,
		tweenInfo,
		{ Offset = Vector2.new(1, 0) }
	)

	-- Setup tween completion callback. Under default constants this will never be called as the tween will repeat infinitely
	self._tween.Completed:Connect(function()
		self:_TweenCompleted()
	end)

	return self
end

from shime.

RyanLua avatar RyanLua commented on July 3, 2024

I didn't push any commits? I'm not sure how I solved this issue but alright.

from shime.

 avatar commented on July 3, 2024

You mentioned this:

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

from shime.

RyanLua avatar RyanLua commented on July 3, 2024

You mentioned this:

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

I'm not planning to introduce a new constructor yet as it will break all pre-existing ones and require me to update all documentation for a small change which gives little benefits.

So I don't get why this is marked as completed.

from shime.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.