Fluocam

author:
esdebon
description:
Virtual camera for Starling and Mobile Devices
compatible:
v1.1
tag:
virtual camera, virtual cam, camera, cam, fluocode, fluocam
homepage:
https://github.com/Fluocode/Fluocam
download:
https://github.com/Fluocode/Fluocam/archive/master.zip

Preview

Download Example: https://github.com/Fluocode/Fluocam/releases/download/0.8/sample.zip

Zoom: CTRL + MOUSE DRAG

Move target cam: On static bird drag the mouse

<flash center 550×400 :extensions:fluocam.swf> wmode direct </flash>

Installation

a. If you’re using a Starling swc, you’ll need to create a starling.extensions package in your src folder.

starling/extensions/fluocode/Fluocam/Fluocam.as
starling/extensions/fluocode/FluocamControl.as

Implementation

import starling.extensions.fluocode.Fluocam;
import starling.extensions.fluocode.FluocamControl;
 
starling.simulateMultitouch = true;
 
var cam:Fluocam = new Fluocam(world,480,320, false);
addChild(cam);

The params in the constructor are:

Fluocam(world:Sprite, widthScene:Number=0, heightScene:Number=0, test:Boolean=true, explorer:Sprite=null, dragAndZoom:Boolean=true)

Where:

Methods

public function working(sw:Boolean=true):void

cam.working(true) // Turn on the camera
cam.working(false) // Turn off the camera
//// The camera is working when since is add to the stage

public function changeTarget(camTarget:Sprite, toMark:Sprite=null, refreshRate:int=1):void

cam.changeTarget(objectInTheWorld)
// Change the target to the sprite "objectInTheWorld"

public function goToTarget(explorer:Sprite, toMark:Sprite=null, controlTo:Sprite=null):void

cam.goToTarget(objectInTheWorld);
// Go with a smooth move to the sprite "objectInTheWorld"

public function targetToTarget(trgO:Sprite,trg:Sprite):void

cam.targetToTarget(objectInTheWorld, otherObjectInTheWorld)
//Move the camera from the first object to the second object

public function zoomToTarget(zoom:Number,durationZoom:Number):void

cam.zoomToTarget( 5.2, 1.5 )
// Zoom in the current position to scale 5.2 in 1.5 seconds

public function explore():void

cam.explore();
//Move the camera on the current target position and then give the control to the camera

Changelog

Source Code

%gist(7794184)%

User Comments

I hope you find it useful