scroll, scrollFactor and zoom

54 views
Skip to first unread message

Phil Mexico

unread,
Mar 14, 2015, 2:44:39 PM3/14/15
to haxef...@googlegroups.com
Hi everyone!

I'd like at one point of my game's gameplay cycle the camera go up, and also zoom out a little, to follow an object that get's thrown upwards and easily out of the screen borders.

This works fine, wether I do it via FlxG.camera.y, FlxG.camera.scroll.y and/or FlxG.camera.zoom.

My problem now is that I need the HUD elements as well as the background to not be affected by this.

The only thing that works so far is if I ONLY do the scroll, i. e. connect the scroll to the height of the thrown object.

Unfortunately, I can't find a way to have the HUD elements as well as the background not be affected by the zoom.

Does anyone have any ideas for me please?

Thanks!

Tembac

unread,
Mar 16, 2015, 3:07:47 AM3/16/15
to haxef...@googlegroups.com
You have to use a second camera for the HUD. Check the camera demo to see how it is done:

Phil Mexico

unread,
Mar 16, 2015, 10:46:36 AM3/16/15
to haxef...@googlegroups.com
Awesome. Many thanks!
Reply all
Reply to author
Forward
0 new messages