Jump to content

Nipplejs joystick not showing up on playcanvas or threejs


GamerWael
 Share

Recommended Posts

I have tried to implement a simple nipplejs joystick on playcanvas(engine only version) as well as threejs but the joystick isn't showing up even in static mode. I'm sure I'm instantiating it properly as I have tried it on anothe div on the same page and it works, but it doesn't work on the canvas.

 

<canvas id="application"></canvas>

<script>

//Game code

var options = {
    zone:document.getElementById("application"),
    color: "white",
    size: 100,
    threshold: 0.1,
    fadeTime: 0,
    multitouch: false,
    maxNumberOfNipples: 1,
    dataOnly: false,
    position: {bottom: "100px", left: "100px"},
    mode: "static",
    restJoystick: true,
    restOpacity: 0.5,
    lockX: false,
    lockY: false,
    catchDistance: 200,
    dynamicPage: true,
};
    var manager = nipplejs.create(options);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...