Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Touchscreen input on my Android does not work with my code please help

Author
Message
Jonney
9
Years of Service
User Offline
Joined: 29th Nov 2014
Location:
Posted: 29th Nov 2014 17:35
Hello,

I am really stuck.

The code below works perfectly on my laptop.
I use the mouse to click on the sprite and it disappears.

But when I broadcast it to my Android phone it shows the sprite moving around on the screen with the text as normal. The problem is that the input does not work. When I tap the screen on the sprite it should disappear but it does not detect the input. I just can't figure out why.

I would really appreciate any help with this.

'red_monster.png' file is attached


Attachments

Login to view attachments
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 1st Dec 2014 21:00
works fine for me although i think this should be in an if statement like so


otherwise try
setspritevisible(getspritehit(pointx(),pointery()),0)
or something like that?

life's one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 14th Dec 2014 01:11
@Jonney, the way you have your original code, just pressing the mouse button will make the sprite disappear. You'll need to modify your code as smallg suggests if you only want the sprite to disappear when the mouse is on it.

As for the code not working on android, it could be that you're saving the GetPointerPressed result to a float. Try saving it as a integer.

Login to post a reply

Server time is: 2024-03-29 15:02:59
Your offset time is: 2024-03-29 15:02:59