I can't get my head around this. I'm trying to make a book that will always have the spine in the middle of the screen. I've set the spine x pos to be windowwidth. But when I resize the browser window, it moves around the center. What am I doing wrong?
I've included some target resolutions in the background as guides.
https://dl.dropboxusercontent.com/u/10196246/Windowwidth.capx
Develop games in your browser. Powerful, performant & highly capable.
You are mixing ViewPort & Window.
TextMain.X = (ViewportLeft(0)+ViewportRight(0))/4
Spine.X = (ViewportLeft(0)+ViewportRight(0))/2
That's a definite improvement. Thanks! However, when I match the browser to the ipad dimensions (blue background), the text is too far to the left and goes off screen. Why doesn't it go in to the middle of the left page?
I've been fighting with this myself. It's because of "Scale inner". The trick I'm using is to reference a sprite Anchored top-left.
You've forced me to think about this, and I've finally figured it out. You can't assume ViewPortLeft is zero.
Ahhhh! You rule! Thanks.
Edit: For future reference, this was the solution:
(ViewportLeft(0) + (ViewportLeft(0)+ViewportRight(0))/2)/2