Baron's VCam (in development)

Version 0.1: trying to fix the VCam

I… almost did a thing.

when reading this post about the vcam not working, i thought, “you know what let’s see why this doesn’t work”, so i looked through the vcam code, made my own (based on the original), and tried to see what’s up.

i think i know why the vcam, in html, does not resize correctly.

  • without the vcam, an html export knows how to resize the project on its own
  • with the vcam, the html and the vcam are resizing at the same time, causing incorrect resizing

so what i did is that i made the vcam undo the html’s resizing before doing its own resizing. and it works well until the ratio of the width or height of the window to the project’s width/height gets too small.

i also didn’t exactly copy the vcam code (i don’t know why), so there could be bugs.

there’s a side-effect of fixing the html, which is that now in the editor or any other iframe, the resizing is incorrect (in an iframe, the html seems to know how to resize correctly for some reason). i tried to have the code determine whether it’s in an iframe or not, but it doesn’t work, so it’s commented out.

open the html file to see what my changes do. open the wick file to see my code and what happens if it’s used in the editor. any help is appreciated.

original files

Baron’s VCam 0.111-26-2021_14-29-40.wick (7.8 KB)
Baron’s VCam 0.111-26-2021_14-29-45.html (2.1 MB)

edit: turns out, works exactly the same if you just add the canceling-out in the original vcam… don’t need to bother reinventing the vcam with the risk of bugs. download the wick file and export it as html.
Baron’s VCam 0.111-26-2021_14-48-04.wick (9.2 KB)

3 Likes

i’ll take a look to this later … ill need to implement a camera thing sooner or later… :smiley: :star_struck:
probably you have something valuable in here…

1 Like

0.1.1, different update thing.

the following message thing is copy-pasted from the code.

i didn’t put this in, but i made it so that the code knows whether it’s in the editor or not. (it looks at the url and checks if it has “wickeditor.com” in it, and it does something based on it). so far, it’s been successful at correctly resizing the vcam.

Baron’s VCam 0.1.111-27-2021_11-19-13.wick (9.6 KB) wick file
Baron’s VCam 0.1.111-27-2021_11-14-25.html (2.1 MB) html file
https://wickvcamtest.baronawc95014.repl.co/ repl (basically just html)
https://baron95014.itch.io/wick-vcam-test itch

using hamzah’s iframe thingy, i can also verify that it works in a generic iframe. (i tested the iframe in wick and in html)

i didn’t change any of the html code other than the name (from “loading…” to “wick vcam test”).

1 Like

0.1.2

the current features are:

  • in most cases, the vcam accurately zooms, even when html versions zoom by themselves
    • the exception i found is when you preview the project in a new window by pressing OptionK. since the URL is still “wickeditor.com/editor”, there’s no way to tell the difference with a URL. if anyone can find out how to determine whether a project is exported or in the editor, let me know.
  • the vcam’s borders should never lag behind or go ahead the camera itself (when moving the camera) (my brain’s too small to determine whether the borders are ahead or behind the vcam, but it’s one of them)
    • this is done by cloning the original vcam and using that as the border, instead of using the vcam as its own border. the code is strategically ordered so that the borders are always aligned with the camera.
  • the vcam has a new look
    • i just felt like doing something… so now it’s striped. should make it slightly easier to tell where the vcam is. it also looks nicer, more… modern or something.

the wick and html files have a demonstration.
Baron’s VCam 0.1.211-28-2021_12-05-42.wick (11.8 KB)
Baron’s VCam 0.1.211-28-2021_12-05-47.html (2.1 MB)

the wickobj has purely the vcam.
vcam wickobj (google drive)

please report bugs if you find them.

BUGS

  • when the vcam starts a different size, it doesn’t correctly resize in html (edit: it doesn’t resize correctly at all, the width/height ratio changes during zoom)
2 Likes

This is very cool

Version 0.2: bug fixes

turns out the bug was in the example, not the vcam itself. but it should be fixed now.
Baron’s VCam 0.212-1-2021_17-05-43.wick (10.2 KB)

next update should have quality-of-life additions, like being able to easily change the size of the vcam while keeping its current scale. by then it’ll probably be 1.0. let me know what other things you want.

5 Likes

you can’t click on anything through it, if your project is interactive, use the wick regular vCam

1 Like

i think i know why it happens, but i dont have my computer with me. it might be because the “inside” of the vcam is filled in and it blocks the mouse from clicking. i’ll fix it when i can, thanks for bringing this up.

it doesn’t work on html exports for some reason

original

i figured out the issue!
The regular vCam has a 3rd frame inside of the clip. which allows you to click, however the bCam doesn’t have that frame, i present an unofficial 0.2.1
vcam5-11-2022_16-18-27.zip (2.5 KB)
(extract zip and add wickobj to project.