Scroll the camera correct?

0 favourites
  • 4 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • So the intention about this question is to determine which kind of scrolling would be the most performant one. I readed that you can use a parallax scrolling or a camera scrolling.

    parallax scrolling would move each layer - with all objects and instances on which you included some parallax values. - Camera/Window is fix, Layers will be moved.

    camera scrolling would only move the system "window" part through the whole stage. - Camera/Window will be moved, Layers are fix.

    In my opinion the camera movement would be the best solution to save performance durring runtime. Except if youre using a static layout with static objects like i do.

    Does someone agree with this these? Or does both scrolling variantes cost the same performance? On the other hand i included a touch input tutorial whitch worked fine - but each layer had to be moved via parallaxing. So i would need only the camera to move. (I would need this, because i got a mini map and a ingame map i have to switch between - the minimap coordinates would have to be translated into the bigger ingame world coordinates - so if you click onto the right corner on the minimap, the camera should be on this location in the ingame map (#factorX/Y))

    i hope you understand why iam thinking about this decission how i could move the camera in the game.

    I hope someone can help me out with this thing. And yes i was reading the forum about this. But i got the feeling that nothing fits to my case.

    Best regards to you and thanks for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Dude i don`t understand.. But if u ask for a suggestion about scrolling.. I will choose behaviour : Scroll to

    Read has no readed- It`s pronounce read(rat/rad)

  • so if i am understanding right you want an effect like a RTS so you could move the camera really fast across the map.

    Now lets talk about camera there a cool plugin call scroll to.

    Best way to do this. Use an invisible sprite put the scroll to on it. next part is tricky because this require Math from hell Like i do not even know where to begin because it depend on how you have your mini-map setup. I suppose you could do something like during scrolling behavor just see where and if there a math relation between minimap and real game.

    One idea you could do is called reverse engineering set up a text box with a every tick condition and now I want you to make two sprite oneis for ingame camera and other is the ingame minimap camera. Next add this in as an action Set text to (Ingamecamera.x &","& ingamecamera.y&"|"& Minimapcamera.x &"," &Minimapcamera.Y)

    This would tell you the exact X ,Y of your camera in game sprite and the minimap sprite. Now when you run it write it down and make at least three set of number for each position. From there try to work out a math function that would give you the result you want on paper.

    For example If i had the number 100 ,100 for ingame and then mini map ingame only gave me say 200,200 we would know that the relation between the two number is divide by 2. So it would be like when mouse overlap mini map and then when the mouse touch a spot in the mini map we would know minimap sprite is at somewhere mulply of 2 so then we move the camera sprite at position x,y for both it would be like minimap.X/2 for the camera position

    But like i said every game is different in their minimap relation to ingame so you are going to have to do reverse engineering. And if you need help then try to give us the numbers to see if we can work out a math function for you.

  • Gearworkdragon Thank you for your answer and for your support offer . I will try it out tomorrow and i will tell you if it works or not. But basically i figured out, that i was wrong in my first post. Each Scroll To function works only if the layer got values in their parallax property. That was confusing. I thought that Scroll to wouldnt need the parallax setting on the layers.

    But the main thinking is the same so the minimap and the ingame map should stay in relation to each other with a scale factor or something like that.

    Is the fact right, that you have to set the parallax values? is there no other way to move the camera if the parallax values are changed to 0,0?

    Best regards to you Gearworkdragon

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