Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Ashkettle

I'm nearly done coding a plugin for adding touch-based controls.

The first release will be a simple Thumb-Joystick. It will obviously come out of the box with the ability to do some customization for your game. If anybody is planning on using a dual-stick approach, this should also support that out of the box (or at the very least, that will be the first thing I'll be adding.

After that, I'll be looking into buttons.

ETA is expected to have it working within a week (I have a working prototype outside of Impact now). At that point, the code will be on GIT for all and sundry.

1 decade ago by bobdabuilda

Nice! Looking forward to it!

1 decade ago by Ashkettle

https://github.com/idiotcoder/ThumbPad

First iteration is there. I have some documentation to add, but there is little enough code that it should be easy to work out. Expect some additions and fixes.

1 decade ago by Jerczu

That looks absolutely awesome and saves me a lot of work (as long as it does what it says it does). Will try it today on my pacman clone.

1 decade ago by Ashkettle

I got it working great on my iphone and ipad for my stuff. If you have any problems, let me know and I'll do what I can to help you out.

Keep in mind that right now, it's in about as bad a state as I was willing to submit it at. It's in need of a good refactor and tighter integration with Impact in general. I'd also like to add a compass telling the degree the pad moved instead of just deltas of the X,Y and UP/DOWN/LEFT/RIGHT. That's on my TODO list. Of course, I want to allow for images to be drawn instead of the circles (allowing for complete customization of the look). That's also on my list.

1 decade ago by Jerczu

Is there a way to test it on non-touch based equipment? I know chrome is faking the touch controls.

1 decade ago by Ashkettle

You could pretty easily wrap the touch event handlers (if you look at the three handlers, I use very little from it) and call them based off a mouse event. I exposed them for just that reason.

I had my ipad right beside me when coding, so I didn't have to do it. I won't be home tonight to get anything done (javascript meetup actually), but if you need something right away, this should explain what's going on somewhat in the event handlers...

http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/

1 decade ago by Jerczu

Well it seems that the controls are not being initialised following your guide on github. None of the controls appear for me and I test it on my phone with touch controls. Either I am doing something wrong (and I think I do) or it just doesnt work although I am testing it on Android but I would believe that they use the same events.

1 decade ago by Ashkettle

I never tested it on Android, as I don't have an android device. I'll bet the events on Android are a bit different. I'll do what I can to check that out.

1 decade ago by Ashkettle

I should be able to look at this over the weekend. There is a reason I wanted to hold off releasing them until they were tested more. They work awesome for me, but "it works on my machine" is never a good answer.

1 decade ago by Ashkettle

To continute, what device are you using?

http://www.html5rocks.com/en/mobile/touch.html

this is an interesting article that discusses support.

1 decade ago by Jerczu

@ashkette I used HTC Desire phone - And yes it does return false on createTouch. But when I circumvented it simply setting it for true it still didn't create controller for me.

I wouldn't worry mate that was just a test and I know you're still working on it so I don't expect miracles. I'm getting my new shiny iPad soon so I will play around again once I have it.

1 decade ago by fugufish

@Jerczu side question abt HTC Desire, did you have problems with the browser automatically zooming upon double tap? It hurts the overall game experience for games requiring more taps. How did you solve that problem?

1 decade ago by Jerczu

@fugufish - Yes the double tap is a b** and I've noticed it but hadn't time to actually mess around with it.

Also the canvas performance on HTC (I would think on all pre-android 3 devices) is just really bad.

Apparently appMobi will do directCanvas for Android by Jan.

Android 3 has this functionality already built in so Canvas on any Android3 device is hardware accelerated.

1 decade ago by stratman05

Where'd you hear the DirectCanvas for Android by January ;)

Android Webview does not allow for multi-touch period. Hopefully ice cream sandwich fixes it, but it'd be another year or so till devices are upgraded and new devices have it.

1 decade ago by Jerczu

Quote from stratman05
Where'd you hear the DirectCanvas for Android by January ;)

Twitter. Following @appMobi.

1 decade ago by Jerczu

Don't want to be a royal pain but it doesn't work on my iPad as well

I followed the description on github. Are you sure that's all that is needed to make it work?

1 decade ago by Ashkettle

Ok, I'm going to make the assumption that you are doing this from a web-page and not through AppMobi yet. I still don't have it tested and integrated with direct canvas (as I stated).

Is it not drawing the control on press? Send me an email at richard.ashkettleATgmail.com and we can work through it. I'll send you some code if necessary that should show it working. I'm sure it's something small.

1 decade ago by Jerczu

Hey - I don't know what was wrong then but I tried again recently and it works perfect. Good work man.
Page 1 of 1
« first « previous next › last »