Context Action Utility

Hello all! Today I decided to program a wrapper class of sorts for the context action service because of how awful difficult to use the mobile support is. It is intended to work identically to the original context action service except with better mobile buttons and some more functionality for mobile buttons. I currently have everything working but am deciding on a few final features.



API (current)
  • BindAction(String actionName, Function functionToBind, bool createTouchButton, Tuple inputTypes)

  • UnbindAction(String actionName)

  • SetTitle(String actionName, String title)

  • SetImage(String actionName, String image)

  • SetActivationColor(String actionName, Color3 color)

  • GetButton(String actionName)

Functionality for the less important ContextActionService functions will (probably) be added.


Info & Pictures
  • Added functionality: SetActivationColor

  • Up to 6 buttons with no positioning needed, it’s all automatic!
  • More button “slots” can easily be added!

  • Using Unbind on an action removes the button and opens the button’s slot for the next button!
  • Button slots are filled out in a specific order to make it so buttons are as easy to press as possible.



Please fill out this small feedback questionnaire. This will help me a ton to decide which features to add!
  • I would use this if I needed it.
  • I would use Roblox’s context action service for mobile buttons.
  • I would make my own mobile buttons.

0 voters


The system currently only supports 6 buttons at a time (though this could be changed easily with little coding experience.
  • 6 buttons is enough
  • I might need more than 6 buttons
  • I need more than 6 buttons

0 voters


Currently, the system only supports buttons around the jump button. Do you think that having buttons by the joystick is important too? (This would mean more than six buttons, by the buttons would need to be set to be around the joystick)
  • I need buttons around the joystick.
  • I want buttons around the joystick
  • I don’t think this would be important.

0 voters



Thanks for the help everyone! All feedback is appreciated! I will be making this open-source next weekend, 10/4/20.
12 Likes

I really like this, I’m not planning on making any games needing a mobile version. But it seems you do. And you executed the GUI really well. Good job!

This is a really cool module!

But how where did you get the assets to make the buttons look like the regular Roblox buttons?

maybe GitHub? :confused: I am pretty sure they release images for the buttons so that you can use them in your game. There is no way he made them by hand.

the buttons are easy to make. its doesnt have to be hand drawn. i’m not sure about mobiles buttons but the game files actually provides pngs of different roblox icons without any encryptions. i’m assuming he got it from there or he just did a quick photoshop lol

1 Like

I am planning on releasing the template I made. Its really easy to make them. Its just a black and white ring set to about 0.5 transparency. I used google drawings (a free power point like vector editing software). I traced over the button image from the roblox player file to get the right proportions.
Edit: Here is the template for anyone who wants to use it:
Untitled drawing (65)

As you can see its not much.

You are correct, I did use the Roblox file and its not encrypted in any way. You can use the explorer on studio to get the file location.

Open Sourcing Updates


Summary

Hello again everyone! Thanks for the great feedback. Unfortunately, it looks like I can’t easily add buttons around the joystick because of how the new joystick works. This might be added later. I added a few more ContexActionService functions, including BindActionAtPriority. I have almost finished the article and plan on releasing this weekend! I have made a few cool examples using code from the wiki to show how seamlessly CAS2 works with Roblox’s CAS.


Coming Soon

  • I am planning to add a function to switch the default jump button to a CAS2 style button just so everything matches.
  • I am going to draw some vector buttons for everyone to use. Asset URLs will be provided in the modules comments too.

Release

Should be coming this weekend.
Edit: I have been swamped with a ton of homework so it will come out a bit later. Really sorry about that.

Alright thank you, one more question though. How are you able to detect if a Player is on mobile? Do you use ContextActionService under the hood, UserInputService’s TouchEnabled, or something else I’m missing?

It is a wrapper class, so it does use ContextActionService. It basically works interchangeably with the ContextActionService but with better mobile support. You are correct too, I use UserInputService’s TouchEnabled.

Open Sourced!


Hello everyone! I finally got around to finishing the module and getting rid of (almost all) the bugs! I finished 14 more buttons that are all available on Roblox and on Google Drive. I also renamed the module ContextActionUtility.


You can get and read about the final product here:

New Project (1)