ButtonClick - Animated buttons

ButtonClick

What is ButtonClick?

ButtonClick is a module to easily give your buttons cool animations. I have also released 4 demo buttons which can help show you how this modules works.

Examples

https://gyazo.com/9fdf9bd39891cf7ea37071952ba5c3f6.gif

Usage

ButtonClick:Click( container object, indefinitely bool )
ButtonClick:UnClick( container object )

Use it

Use this by taking the place file containing the module and demo buttons

74 Likes

Awesome! Thanks! I finally need not create my own!

1 Like

This is nice and all, but isn’t this module pointless? I could literally accomplish this with one function: button:TweenPosition()

Assuming that’s all the module does under the hood (I can’t inspect for myself as the place won’t open), I also think you’re shooting yourself in the foot using OOP for something so simple.

Am I understanding this wrong?

10 Likes

Yeah, seems pretty useless to me, pretty trivial to implement yourself.

1 Like

While you could implement this easily with :TweenPosition, this module could be a good place to start for some beginners or good for those who don’t want to script.

3 Likes

Would you not have to script the buttons either way? Buttons are generally pointless when they don’t do anything.

As @Intended_Pun thought, it uses TweenPosition.

2 Likes

I’m assuming it would be for those who don’t know scripting.

1 Like

Could just upload the 2 different images and use PressedImage

2 Likes

His module tweens the button (not instant, like PressedImage is.)

This is just to keep it as simple and easy as possible. Anyone without any knowledge of scripting can get a cool button animation, this was the goal.

As @fireboltofdeath correctly stated, that will instantly just change the image while this animates the button press

1 Like

Anyone without knowledge can do this though. I’m being extremely blunt with this but someone can make this by referring to the Roblox wiki.

You’ve in a way over-complicated this as a new programmer looking through your code would assume that this is how they must make animated buttons using an Object Oriented Programming style.

Furthermore, you require a object named “Button” which is not clarified and you also have no reason to require a container, instead you can just take the button itself which also would make it so you did not need to hardcode a object name. You should allow for a container and a button to be provided rather than only a container.

7 Likes

Most people can; but they might not want to.
This is good for:

  • Beginner Scripters
  • Builders who cannot script or have very limited scripting knowledge
  • People who would just have a non-animated button; but with this they can have an animated one.
  • Lazy People.
1 Like

It’s roughly 10 lines of code. The category of lazy people for that would be quite low.

2 Likes

Only 10?
Point taken; it looks like it could be done.
If you were that lazy you shouldn’t be programming…


@UndecidedFactor How long did you spend making this? It’s amazing.


Remind me to use these in my game. :slightly_smiling_face:

Thank you so much! I needed this! :smile:

1 Like

While others may think this is extremely basic and easy to implement yourself, I think the point of community resources is to provide for the community. So even if only one person finds this useful and uses it for their games, I think @UndecidedFactor would have done their job in providing for the community.

2 Likes

I agree. I am not experienced with UI Design and I wouldn’t have known that you needed an extra shadow part underneath to achieve the effect. This was really helpful.

This is pretty useful for those who don’t want to program something like this and or are too lazy to do so.

I’d also consider changing:

ButtonObject:TweenPosition(UDim2.new(.5, 0, .15, 0), "In", "Quint", .08)

to:

ButtonObject:TweenPosition(UDim2.new(.5, 0, .15, 0), "In", "Quint", .08, true)

Nothing much, just adding a true so it overrides the previous tween just so it runs a bit nicer, honestly just a personal preferance if you want it or not - but overall yeah this is pretty cool.

A better implementation- and more suited for beginners, would be to have a single function you pass a button into. Then the function can handle all of the animation itself based off of .MouseEnter, .MouseLeave, .MouseButton1Down, .MouseButton1Up.

4 Likes

The thing is, if someone didn’t know how to script, they wouldn’t understand how to use this module either. And if they did have some basic knowledge of scripting, I would encourage them to just make this themself. It’s not hard at all.

If this is targeted at non-coders, it would be better as a free model instead of a module.

I mean yeah… that’s in the title. I’m not saying OP shouldn’t share this, I’m just saying this approach to sharing isn’t the best and is actually over complicating something simple.

1 Like