Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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.
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.
Develop games in your browser. Powerful, performant & highly capable.
Ahhhh! You rule! Thanks.
Edit: For future reference, this was the solution:
(ViewportLeft(0) + (ViewportLeft(0)+ViewportRight(0))/2)/2