Fix joysticks not being visible by default on mobile
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
import GrahamScan from "./vendor/lucio/graham-scan.mjs";
|
||||
|
||||
class Joystick {
|
||||
constructor(ctx, x, y, radius) {
|
||||
constructor(ctx, x, y, radius, visibleByDefault) {
|
||||
this.ctx = ctx;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@ -13,7 +13,7 @@ class Joystick {
|
||||
this.nubX = x;
|
||||
this.nubY = y;
|
||||
this.active = false;
|
||||
this.visible = false;
|
||||
this.visible = visibleByDefault;
|
||||
}
|
||||
|
||||
draw() {
|
||||
@ -892,8 +892,8 @@ function updateModuleDisplays(robot) {
|
||||
* BEGIN ANIMATION CODE
|
||||
*/
|
||||
|
||||
const leftJoystick = new Joystick(ctx, -250, 250, 100);
|
||||
const rightJoystick = new Joystick(ctx, 250, 250, 100);
|
||||
const leftJoystick = new Joystick(ctx, -250, 250, 100, supportsTouch);
|
||||
const rightJoystick = new Joystick(ctx, 250, 250, 100, supportsTouch);
|
||||
|
||||
function drawGrid(ctx, sideLength, gridSquareSize, xOffset, yOffset) {
|
||||
ctx.save();
|
||||
|
||||
Reference in New Issue
Block a user