I wasn’t intending on creating a new vcam to begin with, but one thing led to another, and I somehow created a new vcam starting from an empty project.
Note: The borders are coded to cover only the area that is visible and not inside of the vcam in version 0.1.
Wick File (version 0.1) (12.8 KB)
(Note: I shared version 0.2 below)
KEYS:
(Note: To remove these keys, go inside of the first frame in the layer titled “vcam,” and delete the code in the update script. These keys were only added for testing purposes.)
right = Pan right
left = Pan left
up = Pan up
down = Pan down
space + right = Increase vcam’s width
space + left = Decrease vcam’s width
space + up = Increase vcam’s height
space + down = Decrease vcam’s height
w = Increase vcam’s width and height
s = Decrease vcam’s width and height
d = Rotate right
a = Rotate left
Note: It’s recommended to keep the vcam below the borders clip only so that the borders move at the same speed. The file for version 0.2 is below in this post, if you use that version you won’t need to worry about this.
Here's the vcam code in text (for version 0.1)
- Default Script (2 lines)
this.project.renderBlackBars=false;
this.gotoAndStop(2);
- Update Script (10 lines)
var WHDW = window.innerHeight/window.innerWidth;
var PHDW = project.height/project.width;
gh = WHDW < PHDW?project.height:(project.width/window.innerWidth)*window.innerHeight;
gw = WHDW > PHDW?project.width:(project.height/window.innerHeight)*window.innerWidth;
var k = this.height/gh;
var k2 = this.width/gw;
this.project.zoom = k2>k?gw/this.width:gh/this.height;
this.project.pan.x = -(this.x - project.width/2);
this.project.pan.y = -(this.y - project.height/2);
this.project.rotation = -this.rotation;
Report any issues or recommendations here, and I’ll take a look at them later. Feedback is also appreciated.
Thanks for reading :)
EDIT:
For those who are used to using the built-in vcam and prefer to have the borders inside of the vcam’s timeline, I’ve decided to take the current vcam asset, and with some adjustments, implemented my vcam’s zoom code inside of it so it works the same way as my vcam.
Wick File (version 0.2) (12.1 KB)
(Scroll down for the latest version)
Note
I used the same panning and rotation code from the original vcam since those weren’t broken.
Feel free to use this in any of your projects, no need to ask.
If you want to know how this works, feel free to ask, I’d be glad to explain!
I’m planning on creating a website with wick for sharing wick tutorials & assets, so I’ll add an explanation to this there as well when time comes :)