PhatKitty
02-20-2009, 04:01 PM
I have a vcam and it's working fine, following my char in my platformer, but the problem is I can't draw anything inside my vcam without removing the "this._visible = false" but this bit is needed. I'm using this as my vcam script:
function camControl() {
var _l4 = sX/this._width;
var _l3 = sY/this._height;
_parent._x = cX-this._x*_l4;
_parent._y = cY-this._y*_l3;
_parent._xscale = 100*_l4;
_parent._yscale = 100*_l3;
}
// End of the function
function resetStage() {
var _l2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_l2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
// End of the function
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = Stage.width/2;
var cY = Stage.height/2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
this.onUnload = resetStage;
//V-Cam Script
What I want is to have my inventory of 5 weapons always at the top left of the screen, and I figured that would be easiest to put it inside my vcam.
function camControl() {
var _l4 = sX/this._width;
var _l3 = sY/this._height;
_parent._x = cX-this._x*_l4;
_parent._y = cY-this._y*_l3;
_parent._xscale = 100*_l4;
_parent._yscale = 100*_l3;
}
// End of the function
function resetStage() {
var _l2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_l2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
// End of the function
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = Stage.width/2;
var cY = Stage.height/2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
this.onUnload = resetStage;
//V-Cam Script
What I want is to have my inventory of 5 weapons always at the top left of the screen, and I figured that would be easiest to put it inside my vcam.