Level Director in game zoom

Hi,

Is there a way to zoom out when you run faster, and in when you run slower built into Level Director?

Thanks, Greg

Hi Greg,

You can scale the whole level by using something like below, as level.view is a displayGroup.

myLevel.level.view:scale(2,2) -- scale all layers by xScale, yScale or myLevel.level.layers[1].view:scale(2,2) -- scale a single layer

I did a quick test and it seems to work, but when I used an example that is part of composer it didn’t, so this will need some more investigation.

I was being stupid, it does work with Composer but I was trying to scale in the ‘Create’ phase which doesn’t work, providing you scale within the ‘Show’ phase/event then it works fine.

So for your example, you would apply a scaling factor to the level/layers based on your players speed, maybe by using a transition to make it smooth.

myLevel.level.view:scale(2,2)

Does this work with Level Director , or do I have to port to LDX to make this work?

I can’t tell you how much I appreciate Level Director, it really takes the pain out of level design!!!

btw, I purchased LDX, but need a serial to unlock the old version to work a LD file.  I tried my LDX serial in the old version but it doesn’t work.  Can I get an unlock to the old one?

Thanks for the help, Greg

Yes, this code should still work with the original Level Director, if not, let me know.

I’ll contact you directly about the serial code.

The scaling function works great for the view objects, but it doesn’t seem to scale the physics bodies attached to the objects.  Is there a way to do this or to possibly implement a ‘camera zoom’ ?

Thanks, Greg

Hi Greg,

You can scale the whole level by using something like below, as level.view is a displayGroup.

myLevel.level.view:scale(2,2) -- scale all layers by xScale, yScale or myLevel.level.layers[1].view:scale(2,2) -- scale a single layer

I did a quick test and it seems to work, but when I used an example that is part of composer it didn’t, so this will need some more investigation.

I was being stupid, it does work with Composer but I was trying to scale in the ‘Create’ phase which doesn’t work, providing you scale within the ‘Show’ phase/event then it works fine.

So for your example, you would apply a scaling factor to the level/layers based on your players speed, maybe by using a transition to make it smooth.

myLevel.level.view:scale(2,2)

Does this work with Level Director , or do I have to port to LDX to make this work?

I can’t tell you how much I appreciate Level Director, it really takes the pain out of level design!!!

btw, I purchased LDX, but need a serial to unlock the old version to work a LD file.  I tried my LDX serial in the old version but it doesn’t work.  Can I get an unlock to the old one?

Thanks for the help, Greg

Yes, this code should still work with the original Level Director, if not, let me know.

I’ll contact you directly about the serial code.

The scaling function works great for the view objects, but it doesn’t seem to scale the physics bodies attached to the objects.  Is there a way to do this or to possibly implement a ‘camera zoom’ ?

Thanks, Greg