A handy camera dolly with several advanced features Thanks to Itay Keren and his amazing GDC talk "Scroll Back: The Theory and Practice of Cameras in Side-Scrollers"

Constructor

new (options:DollyOptions)

Creates a new Dolly with given options.

target:FlxObject,
?camera:FlxCamera,
?lerp:Float,
?max_velocity:{ x:Float, y:Float },

Parameters:

null

options

Methods

get_position ():{y:Float, x:Float}

get_target ():FlxObject

set_position (x:Float, y:Float):Void

set_position_from_flxpoint (p:FlxPoint):Void

set_position_relative (x:Float, y:Float):Void

set_position_x (x:Float):Void

set_position_y (y:Float):Void

@:value({ snap : false })set_target (target:FlxObject, snap:Bool = false):Void

Sets the target for the dolly

Parameters:

target

FlxObject

snap

Whether or not to immediately snap dolly to target

Static variables

@:value(0)staticc:Int = 0

Inherited Variables

Inherited Methods

Defined by Entity

add_tag (tag:String):Void

Add tag to this Entity

 *  @param tag	tag name

get_component (name:String):Null<Component>

Get component with name

 *  @param name	component name
 *  @return Null<Component>

inlineget_name ():String

returns the name of this Entity

 *  @return	String

inlinehas_tag (tag:String):Bool

Checks whether or not this Entity has a tag

 *  @param tag	tag name
 *  @return		Bool

remove_component (name:String):Void

Remove a component from this Entity

 *  @param name	the component's name