Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I note at my desktop PC's chrome this plugin can work,

but at android mobile's chrome can't work

Can you fix it ?

Please .

This is the intended feature, this plugin dsiables itself while oin a mobile device( aka, android, and ios ), the reason being is there is no way to detect if the player is using a mouse or touch input, at least not in pure javascript, this means the mouse cursor will be on the screen EVEN if no mouse is present, and the cursor will be visible on all devices, even the ones the aren't using a mouse, and it will always be at the last position the player touches the screen.

For this to work with only a mouse, this would require a two part solution. I believe there is a way to detect peripheral devices in android studio via the one of these checks in java( not javascript ) "InputManager.InputDeviceListener" or "InputDevice.getSources" and pass this value via js interface to the game so it can be read from the game itself.


From there it's as simple as finding the line in this plugin that checks if the game is running on a mobile device, and including the value passed from Java( I've linked it below ).


This is not something I can program into my plugin directly as It requires code passed from the java side of the android app.


If you truly wish to proceed anyways, here is the code in my plugin that must be changed. Find this function in the plugin, and comment out the line that reads "if ( Utils.isMobileDevice() ) return false;" OR extend it with the value passed from the java end of your app.

//=============================================================================

  $.enableCursor = function ()

  { // enable mouse cursor.

//=============================================================================

    if ( $.enabled  ) return;

    if ( Utils.isMobileDevice() ) return false;

    $.styleParent.appendChild( $.style );

    $.enabled = true;

  }

Perfect !

You are Best !