简体   繁体   中英

Stage2d changing background texture changes the camera zoom! BUG?

we are creating a small race game with a lot of fancy features, which deliever a small flavour of rpg depth.

I have an infinity scrolling background (the road), that consist of 3 textures, which are moving down and go back, so this infitity scrolling effekt is being created. 3 textures are needed for the proper changing of the background, like new street background, fuel stations, car dealers and so on. So I check for example, that in 200 game-meters I must replace one texture by another to make a fuel station visible and scrolling down.

By the first replacement the camera of the stage suddenly zooms in. After going back in to the pause menu and then to the game world screen is everything fine. I am convinced that it has something with an updating of the camera in the render method or resize method.

The funny thing is that I do nothing, only take the texture object and set a new reference to the other texture.

It would be greate if somebody could give a tip or perhaps a solution to this problem.

Thank You for Your answer. It is solved now. The reference to the cam was wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM