1 decade ago by fulvio
In response to the following post I made about iPhone 5 screen width:
http://impactjs.com/forums/help/iphone-5-full-canvas-width
I'm now having problems with my touch event bindings:
Drawing (this is correct as they're drawn fine on iPhone 5):
Screen Size (this works as I get the full width of the iPhone 5):
iOS Bindings (these coordinates are the problem):
The two wrong pictures are dependent on whether I flip the phone around in landscape mode.
I'm aware that because the bindings are originally designed for iPhone 4 and below that I'll need to modify them for the added 44 pixels that the iPhone 5 now has in width, however I can't figure out where to update the code in order to fix it. I've tried a few combinations but I just cannot get it right.
WRONG:
http://impactjs.com/forums/help/iphone-5-full-canvas-width
I'm now having problems with my touch event bindings:
Drawing (this is correct as they're drawn fine on iPhone 5):
this.buttons.drawTile(0, 110, 0, 80, 48, false, false); this.buttons.drawTile(ig.system.width - 80, 110, 1, 80, 48, false, false);
Screen Size (this works as I get the full width of the iPhone 5):
// NOTE the 284 instead of 240 (this and the Default-568h@2x.png is the only change I've made for iPhone 5). ig.main('#canvas', MyGame, 60, 284, 160, 2);
iOS Bindings (these coordinates are the problem):
ig.input.bindTouchArea(0, 224, 80, 96, 'left'); ig.input.bindTouchArea(80, 224, 80, 96, 'right'); ig.input.bindTouchArea(320, 224, 80, 96, 'shoot'); ig.input.bindTouchArea(400, 224, 80, 96, 'jump');
The two wrong pictures are dependent on whether I flip the phone around in landscape mode.
I'm aware that because the bindings are originally designed for iPhone 4 and below that I'll need to modify them for the added 44 pixels that the iPhone 5 now has in width, however I can't figure out where to update the code in order to fix it. I've tried a few combinations but I just cannot get it right.
L = left, R = right, S = shoot, J = jump.
WRONG:

1 decade ago by fulvio
Okay, this part was a no brainer:
iPhone 4S and below:
iPhone 5:
However this only works if I'm in one landscape mode. As soon as I flip the phone around the other way in landscape I get the issue below.
The question is, why is it only working in one landscape mode and not the other?
(Only the areas with letters are tappable, everywhere else just doesn't respond).
Page 1 of 1
iPhone 4S and below:
ig.input.bindTouchArea(320, 224, 80, 96, 'shoot'); ig.input.bindTouchArea(400, 224, 80, 96, 'jump');
iPhone 5:
// 320 as above increased by 80 // 400 as above increased by 80 ig.input.bindTouchArea(400, 224, 80, 96, 'shoot'); ig.input.bindTouchArea(480, 224, 80, 96, 'jump');
However this only works if I'm in one landscape mode. As soon as I flip the phone around the other way in landscape I get the issue below.
The question is, why is it only working in one landscape mode and not the other?
(Only the areas with letters are tappable, everywhere else just doesn't respond).

« first
« previous
next ›
last »