Mobile Buttons: is it possible to resize using CAS?

unknown
Right now i’m making a mobile button but I cant think of a efficient way to resize it, any ideas / features I forgot about?

2 Likes

There is a way: You can access the playerGUI and the ContextActionGUI and resize the buttons in there.

Here’s where I found it:
Link

I hope that solves the problem :smile:

1 Like

Thx for the response and ye ik I can do through playergui but I was just wondering if there was a easier feature to use :slight_smile:

There’s a better way to achieve relatively the same result. The result that Carbyne posted is reinventing the wheel for something that already exists in ContextActionService.

What you’ll need to do is use ContextActionService.GetButton. This returns the image associated with your action, so that you don’t need to dig it out of the PlayerGui. The structure of the context actions hierarchy can change, so it’s better to return the button directly.

Once you have this, you can change it’s size right away.

local PunchButton = ContextActionService:GetButton("Punch")

PunchButton.Size = PunchButton.Size / UDim2.new(0.5, 0, 0.5, 0)

cc @TheCarbyneUniverse

13 Likes

Thanks! I knew there was something obvious I was missing lol

1 Like

but there’s a perfect way to resize it:

This post is two years old. I get you want to help people with your comment, but even then, that comment was on a 7 month old post. If you post on really old threads, the OP probably already solved the issue, and it just puts the thread back into the Latest category (Necroposting).

3 Likes