Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I work with Transparent ImageButtons and Tweening?

Asked by 9 years ago

I've been working on designing a Gui, and I find it hard to create complex, good looking Guis by using Frames and Text, so I used Gimp and made a simple one.

The only problem is that ROBLOX's Decal system is really stupid. Can't upload in GIFs, and PNG/JPG/BMP don't have transparency. So how can I create an Image, and load it transparently into an ImageButton.

Also, relating to this but on the Lua side of things, how can I use UDim2 and Tweening on an ImageButton?

0
UDim2.new(scaleX,pixelX,scaleY,pixelY) is used for Size and Position. Tweening has a longer explanation. Look here for ImageButton methods, properties, callbacks, and events: http://wiki.roblox.com/index.php?title=ImageButton SanityMan 239 — 9y
1
Also, there is a BackgroundTransparency property which may help with your transparency problem. To add onto the other comment, the Tweening method should be similar/the same as Twening other things. Look at the link under Methods. SanityMan 239 — 9y

2 answers

Log in to vote
2
Answered by 9 years ago

PNG does in fact support transparency, I use it all the time. You need to set the frames transparency to 1

Also, you tween Image buttons the same as every other frame, with :TweenPosition() or any of the other tweening methods. http://wiki.roblox.com/index.php?title=Tweening

Ad
Log in to vote
1
Answered by 9 years ago

Since ColdSmoke replied regarding transparency, I'll go into depth about tweening

UDim2 is basically telling the GUI where to move on the screen. I'm assuming you already know how to design GUI's, so look in the position of the GUI. The 4 numbers. To change the position of this you would example.Position = UDim2.new('0,0,0,0') The numbers look kind of like your position, right? That's how you move GUI's.

If you wanna get fancy you can use TweenPosition, this is like UDim2 but moves the GUI smoothly to that part of the display

It's almost the same, instead of doing example.Position it's example:TweenPosition(UDim2.new(0,0,0,0))

0
Thanks. :) SlickPwner 534 — 9y

Answer this question