How do I make zoom work with parallax (tried "everything")

0 favourites
  • 14 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello everybody, I have for a couple of weeks now tried to solve this problem. Have tried "everything". I´ve seen that there are similar problems here and it is parallax with zoom. I have tried really many of those formulas and ideas, but none seem to work for me. One solution would be to set parallax off, but that´s not the solution I´m looking for.

    My main character here is Clark (the constructor guy). Player clicks or taps bolts of beams in order to drop them and help him move around. Also clicking near Clark will give him a push to left or right (or up if clicking clark). He is trying to reach the lunchbox. I have a nice zoom effect with parallax (mousewheel) but I´d like the camera to always zoom into Clark. I have tried unbounded layout etc. I have created invisible object that the camera follows, but it doesn´t work. I have tried the canvastolayoutX. I have tried touch.absoluteX (for player to tap the screen and then move the camera there). Nope.

    I wonder what should I add to make it work. I´d be happy with two options.

    1) Automatic zoom to Clark always.

    2) Player taps the screen (or clicks) and camera moves there with a nice smooth way.

    Sorry for my english. It´s not my mother language.

    btw. This is my first post so I´d like to add that nice community here (so hello again <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> ) and nice software this C2 (even though I´m puzzled by many many things)

    I stripped most of the extra stuff from this capx file (but left in the event sheet 1 some of the try-outs I did in order to make the camera follow either tap or Clark.)

    Hopefully someone can help me out with this one.

    Here is the capx

    https://dl.dropboxusercontent.com/u/104 ... blem1.capx

  • This capx must be started from intro. For some reason this capx tries to start with options (since I removed a lot of stuff there and didn´t fix that.) I removed some behaviours (3rd party plugins). I tried to find if I had uploaded some plugins there, but didn´t find any extra ones.

  • Your link is dead.

  • Thanks for telling me this. It worked earlier today, as I tested it. I wonder if dropbox is down. I follow the situation. Actually I could upload this to mediafire meanwhile. I will do it.

    Edit. It did work just now as I clicked it. I will upload it to mediafire too in case it happens again.

    Here is mediafire link: http://www.mediafire.com/download/fsu5r ... blem1.capx

  • Maybe I could limit the zoom. That would kind of work. I wonder what could be the best way to make a scroll to action to the borders of what-player-sees in monitor. If I would put an invisible sprites to parallax 0,0 global layer and test if they are tapped and then scrolled towards that tapped sprite. I wonder what would be the best way to set scroll to that position?

  • Have you any ideas if the zoom is impossible (since the computer thinks layers different as we humans).

  • Anybody?

  • Any ideas for another way of doing this? I have tried magicam. I have tried making viewport smaller etc but nothing ever works. There must be somekind of an solution. Please help me.

  • I limited the zoom. So this is kinda solved.

  • Would be nice to know if anybody checked my capx and tried to find a solution or was this just totally ignored. Could be useful information.

  • Chill man! It seems that Dropbox was foobarred a few days ago. Everyone's link was broken that I clicked on that day. I'll take a look at your capx.

  • Your answers are all in the manual:

    https://www.scirra.com/manual/102/scroll-to

    With special emphasis on bold:

    [quote:3qjw58af]The Scroll To behavior simply centers the view on the object with the behavior. It is a shortcut for the Scroll to object system action. However, it also provides a Shake action to shake the screen, and if multiple objects have the Scroll To behavior, it will center the view in between all of them.

    If you need more advanced scrolling, e.g. limited to certain regions or following the player after a delay, scroll to an invisible object which you control through events.

    To scroll, the size of the layout must be bigger than the size of the window, or the layout's Unbounded scrolling property must be set to Yes. Otherwise there is nowhere to scroll to and scrolling will have no effect.

    Scroll To has no properties, conditions or expressions.

    Like this:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Chill man! It seems that Dropbox was foobarred a few days ago. Everyone's link was broken that I clicked on that day. I'll take a look at your capx.

    Thank you. Actually I was calm as a wintermorning when writing that

  • Tried it. It didn´t work as expected but when I change to the MAIN layer parallax to 100, 100 and scale rate 100 it works perfectly. It just seems that when those values are different the zoom always goes offset to the sprite which has the scroll to behaviour on it.

    But I am happy with this. I will also change my layoutsize to larger as you kind of suggested even though it didn´t solve the problem. I was a bit scared of making it so large but it works nicely. Thanks for guiding me into the right direction.

    edit: Actually just did try to take the unbounded scroll to NO and it didn´t work so that was actually a very important thing which made it finally work when I changed it to YES! Special thanks for that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)