Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This project is an open-source tool for composing multiple, customized touch screen joysticks with the objective of improving the tooling available to Roblox developers for mobile games.

License

NotificationsYou must be signed in to change notification settings

Bytebit-Org/roblox-TouchScreenJoysticks

Repository files navigation

CI statusPRs WelcomeLicense: MITDiscord server

This project is an open-source tool for composing multiple, customized touch screen joysticks with the objective of improving the tooling available to Roblox developers for mobile games.

Installation

roblox-ts

Simply install to yourroblox-ts project as follows:

npm i @rbxts/touch-screen-joysticks

Wally

Wally users can install this package by adding the following line to theirWally.toml under[dependencies]:

TouchScreenJoysticks = "bytebit/touch-screen-joysticks@1.0.8"

Then just runwally install.

From model file

Model files are uploaded to every release as.rbxmx files. You can download the file from theReleases page and load it into your project however you see fit.

From model asset

New versions of the asset are uploaded with every release. The asset can be added to your Roblox Inventory and then inserted into your Place via Toolbox by getting ithere.

Links

Example

tscreenshot_20200320-164323_roblox
Click here to watch a video demonstration.

It only takes one line of code to create a joystick! Below is an example of just a handful of lines of code that can be used to quickly generate two joysticks, one on each side of the screen, and print their inputs:

import{CompositeJoystickRenderer,JoysticksManager,RectangleGuiWindowRegion,SolidFilledCircle}from"@rbxts/touch-screen-joysticks";import{Workspace,GuiService}from"@rbxts/services";do{wait()}while(!Workspace.CurrentCamera)wait(1);// To wait for screen to flip to appropriate orientationconst[guiInsetTopLeft,guiInsetBottomRight]=GuiService.GetGuiInset();constrealTopLeft=guiInsetTopLeft;constrealBottomRight=Workspace.CurrentCamera.ViewportSize.sub(guiInsetBottomRight);constguiWindow=realBottomRight.sub(realTopLeft);constjoysticksManager=JoysticksManager.create()constleftJoystick=joysticksManager.createJoystick({activationRegion:newRectangleGuiWindowRegion(newVector2(0,0),newVector2(guiWindow.X/2,guiWindow.Y)),gutterRadiusInPixels:50,inactiveCenterPoint:newVector2(80,guiWindow.Y-80),initializedEnabled:true,initializedVisible:true,priorityLevel:1,relativeThumbRadius:0.6,renderer:newCompositeJoystickRenderer(newSolidFilledCircle(Color3.fromRGB(0,170,255),0.8),newSolidFilledCircle(Color3.fromRGB(0,170,255),0)),});leftJoystick.inputChanged.Connect(newInput=>{print("left input",newInput);});constrightJoystick=joysticksManager.createJoystick({activationRegion:newRectangleGuiWindowRegion(newVector2(guiWindow.X/2,0),newVector2(guiWindow.X,guiWindow.Y)),gutterRadiusInPixels:50,inactiveCenterPoint:newVector2(guiWindow.X-80,guiWindow.Y-80),initializedEnabled:true,initializedVisible:true,priorityLevel:1,relativeThumbRadius:0.6,renderer:newCompositeJoystickRenderer(newSolidFilledCircle(Color3.fromRGB(255,85,0),0.8),newSolidFilledCircle(Color3.fromRGB(255,85,0),0)),});rightJoystick.inputChanged.Connect(newInput=>{print("right input",newInput);});

About

This project is an open-source tool for composing multiple, customized touch screen joysticks with the objective of improving the tooling available to Roblox developers for mobile games.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp