Gunther Active Member Licensed User Longtime User Mar 9, 2019 #1 We can set our "zoom" when we set our dimensions before the X2.Start is given. It looks ugly when a change to it is done within the game loop. We can also change the size of objects as done with Mario in the Mario Example. We can also load a graphic to an already loaded/used body which centers the graphic over the fixture. But a real zoom feature I didn't found anywhere. Do we have something like a zoom or how we can get a zoom into or out of a tilemap?
We can set our "zoom" when we set our dimensions before the X2.Start is given. It looks ugly when a change to it is done within the game loop. We can also change the size of objects as done with Mario in the Mario Example. We can also load a graphic to an already loaded/used body which centers the graphic over the fixture. But a real zoom feature I didn't found anywhere. Do we have something like a zoom or how we can get a zoom into or out of a tilemap?
Erel B4X founder Staff member Licensed User Longtime User Mar 10, 2019 #2 Gunther said: But a real zoom feature I didn't found anywhere. Click to expand... This is indeed missing from the X2 framework. I do hope to add better support for zoom in the future. In the meantime try the attached example. It changes ivForeground / ivBackground sizes to create a zoom effect. Attachments TankWithZoom.zip TankWithZoom.zip 81.7 KB · Views: 838
Gunther said: But a real zoom feature I didn't found anywhere. Click to expand... This is indeed missing from the X2 framework. I do hope to add better support for zoom in the future. In the meantime try the attached example. It changes ivForeground / ivBackground sizes to create a zoom effect.
Gunther Active Member Licensed User Longtime User Mar 10, 2019 #3 You are right. It is close to a zoom but unfortunately the animation starts from the screen center. But it could be used as "something like a zoom". A camara object would be good. ;o)
You are right. It is close to a zoom but unfortunately the animation starts from the screen center. But it could be used as "something like a zoom". A camara object would be good. ;o)
Erel B4X founder Staff member Licensed User Longtime User Mar 10, 2019 #4 Gunther said: It is close to a zoom but unfortunately the animation starts from the screen center. Click to expand... You can change it with a bit of math...
Gunther said: It is close to a zoom but unfortunately the animation starts from the screen center. Click to expand... You can change it with a bit of math...
Gunther Active Member Licensed User Longtime User Mar 10, 2019 #5 Well, I tried to get the ground attached to the bottom screen edge but any math did worked since with giving the command of ivForeground.SetLayoutAnimated the ivForeground jumps to the given left and top and than starts the animation of scaling the width and height. Of cause I changed the Duration to 5000 but this looks like it is only for the scaling not for the location change.
Well, I tried to get the ground attached to the bottom screen edge but any math did worked since with giving the command of ivForeground.SetLayoutAnimated the ivForeground jumps to the given left and top and than starts the animation of scaling the width and height. Of cause I changed the Duration to 5000 but this looks like it is only for the scaling not for the location change.