Code I didn't know existed

I kinda glitched out Wick a bit to make it allow me to draw with the pen tool while the project is playing. This only works in the editor, here’s a file:

draw 1-16-2021_12-53-02.wick (2.2 KB)

How I did this:
I set the editors tool to pencil

this.project.activeTool = this.project.tools.pencil;

And then, I stopped the editor from loading the project

this.project._playing=false;

Wick Editor 1.19.2 (3)


There are also other types of code I found out existed just today!
For example, you can turn on onion skinning while the project is playing with this code:

this.project.onionSkinEnabled=true;

Setting it to false turns onion skinning off.

You can also change the background color using this:

this.project.view.canvasBGColor='green';

You can also increase/ decrease the forward/ backwards onion skinning range:

this.project.onionSkinSeekForwards++;
this.project.onionSkinSeekBackwards++;

You can also change the name of the frame using this code:

project.timeline.activeFrame.identifier='ABC_text';

(Oh yes, “activeFrame” refers to the current frame)

I found this code by reading through this:
https://www.wickeditor.com/editor/corelibs/wick-engine/wickengine.js

1 Like

Now we can make a drawing app in wick!

Not quite since this only works with the editor (not html version)

Also, I paused the project and equipped the pen tool to make this glitch that allows you to draw on the canvas. When you try this in an html version, the pen icon will appear, but it won’t draw

yay finally a drawing thingy so I can make drawing software (maybe)

really when i export it as html the pen icon does not apear?

You can’t make one with this method because it only works in the editor.
but you could use cloning to make some kind of drawing thing!

Oh, I was using the window preview version, you are correct, in the html version, the pen icon doesn’t appear

ok YAY

off topic

https://www.youtube.com/watch?v=u0At1MVhpv4

` Jones bbq and foot massage

Ok we are getting off topic

I also found some new code that changes the length of a frame while playing the project:

project.timeline.activeFrame.start=1; // Where the frame starts
project.timeline.activeFrame.end=5; // Where the frame ends

This code makes the frame start at 1 and stretch to 5
The length of the frame resets after the preview ends

project.timeline.activeFrame.start+=1;
project.timeline.activeFrame.end+=5;

wait so you can do the thing up there :arrow_up:

The code you have will give an error because the frame length starts at 1 and ends at 1 by default, so changing the start by one will make it greater than the end length the same time it makes the end greater than the start.

So, what you can do is extend a frame once, then you can add that same exact code in the update script

Example.wick (1.2 KB)

Never knew we could animate frames!

WOAH! Nice demo. Sad we can’t use it -_-