Hi,
I was searching for some code sample showing this effect in action.
Has it been shared on the forums in the past?
How hard would it be to achieve that effect?
(Would like to use it for a storybook)
It has been used for years already, but
here is an explanation.
Thanks
Comments
but then we drop it, since our game is side-scrolling action game, and it made the player feel dizzy. Totally worsen the game.
For story book, i've seen plenty use it even before iOS 7 also.
Yes I do acknowledge the fact that's it's been used way before iOS7 already :
Which I thought would increase the chances that a code sample would have been shared in the forums maybe?
Maybe you have some code sample to share?
But it's just like obtaining from accelerometer, then do something like:
aGroup:setPosition(x,y)
bGroup:setPosition(x * 1.2,y * 1.2)
cGroup:setPosition(x * 0.5,y * 0.5)
Edit: forgot to say that you of course need to process x&y obtained from accelero a little bit.
And yes, there is a better thing to do this, so it would be smoother.
Like giving a target of transition instead of setting it directly.
Do you see what is happening here?
or there :
I don't know well how to explain, all layers don't tilt with the same factor (depending on their virtual distance from the screen).
And I've also attached the sample project, hope that helps
Likes: fxone, Mells
https://play.google.com/store/apps/developer?id=My+name+is+Originality
Wow thank you, I certainly didn't want to reinvent the wheel but didn't expect you to provide a solution.
I have modified the script a little bit (it seems to be bg:setPosition(speedX ##-## fx * speedX (...) by looking at the videos, for example).
1. Would you know how to take the natural position of the phone (when holding it naturally) instead of having it flat as a reference point?
It should be a matter of applying an offset, I'm going to try too..
Or anyone? Arturs already kindly helped
2. On an iPod 5 the bg is totally offset. Don't need to work on it, you probably have better things to do.
thanks again
Edit : there is also a perspective effect. I don't know how to use Matrices (skew is not the right effect) but I believe it's the way to do it.
And by taking reference point, you mean in the state phone launched the app, and then go relatively from there?
Mmm how is Apple doing it with ios7?
It seems that they decided arbitrarily the position in which people are using their phone the most (unless they allow users to calibrate which I think won't happen).
From that position (instead of using the raw accelerometer datas when the phone is on a flat surface) they detect the tilt movement, I think.
if you want to hold it in your hand vertically so it faces your face with screen, you can try replace y value from accelerometer with z value
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
3D Perspective rendering in iOS also add to that sense of realism, maybe bhWax could help. However you will have to set up additional code to include the Transforms, etc into WAX as it is not included at the moment.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps