More wick docs

I find the documentation given by the Wick Editor lacking. There are so much other useful properties that aren’t documented. I got this documentation from the current docs, printing out objects to the console, and looking at the source code.

Global API

Timeline
  • play()

    Plays the parent timeline that this object belongs to

  • stop()

    Stops the parent timeline that this object belongs to

  • gotoAndPlay(frame)

    Moves the playhead to a frame on the timeline that this object belongs to, and plays that timeline
    frame: An integer or string which is where you want the frame to be.

  • gotoAndStop(frame)

    Moves the playhead to a frame on the timeline that this object belongs to, and stops that timeline
    frame: An integer or string which is where you want the frame to be.

  • gotoAndStop(frame)

    Moves the playhead to a frame on the timeline that this object belong to, and stops that timeline.
    frame: An integer or string which is where you want the frame to be.

  • gotoNextFrame()

    Moves the playhead to the next frame on the timeline that the object belongs to.

  • gotoPrevFrame()

    Moves the playhead to the previous frame on the timeline that this object belongs to.

Input
  • mouseX

    The x position of the mouse on the screen

  • mouseY

    The y position of the mouse on the screen

  • mouseMoveX

    The amount the mouse moved on the x-axis in the last tick.

  • mouseMoveY

    The amount the mouse moved on the y-axis in the last tick

  • key

    The last key pressed

  • keys

    An array of all keys which are currently pressed down
    D key = “d”
    L key = “l”
    CTRL key = “control”
    ALT key = “alt”
    PG UP key = “page-up”
    LEFT ARROW key = “left”
    DELETE key = “delete”
    ESC key = “escape”

  • isMouseDown

    True if the mouse is currently pressed down

  • isKeyDown(key)

    Returns true if the given key is currently down
    key: A string

  • isKeyJustPressed(key)

    Returns true if the given key was pressed within the last tick
    key: A string

  • hideCursor()

    Hides the cursor

  • showCursor()

    Un-hides the cursor

Project
  • project

    Returns the project clip

  • project.width

    The width of the project canvas

  • project.height

    The height of the project canvas

  • project.framerate

    The max framerate that you set of the project

Random
  • random.integer(min, max)

    Returns a random whole number between a minimum and maximum
    min: Integer
    max: Integer

  • random.float(min, max)

    Returns a random decimal number between a minimum and maximum
    min: Number
    max: Number

  • random.choice(arr)

    Returns a random item in the given array
    arr: Array

Sound
  • playSound(assetName [, options])

    Plays a sound in the asset library
    assetName: A string that is the asset name
    options: An optional Object that may include:
    {
    loop: bool
    volume: number
    }

  • stopAllSounds()
    Stops all currently playing sounds

Event
  • onEvent(name, fn)

    Binds a function to an event.
    name: A string that describes the event
    fn: The function to bind

Wick.Clip

Uncategorized
  • Clip._cachedSerializeData
    Clip’s default data

  • Clip.setText()

    it literally just throws an error that’s all it does in the code

  • Clip.remove()

    Removes this object from the project.
    If you don’t want code running in a removed clip, check if this.parent !== null. That seemed to work for me.

  • Clip.cursor

    The appearance of the cursor when this is hovered over (only works on buttons)

  • Clip.identifier

    The given name of this Clip

  • Clip.uuid

    A randomly-generated unique identifier for this Clip

  • Clip.view

    A Wick.View.Clip, which is what is rendered on the screen.

  • Clip.bounds

    A Rectangle that describes the bounds of this Clip

  • Clip.hitTest(other)

    Checks if this Clip’s bounds intersects with the other’s
    other: Can be a Clip
    This is deprecated from 1.19 and onwards

  • Clip.animationType

    The animation type of this Clip

  • Clip.isFocus

  • Clip.isRoot

  • Clip.isScriptable

  • Clip.isSelected

  • Clip.isSynced

  • Clip.lineage

  • Clip.name

  • Clip.needsAutosave

  • Clip.playedOnce

  • Clip.singleFrameNumber

  • Clip.syncFrame

  • Clip.breakApart()

Transformation
  • Clip.transformation

    A Wick.Transformation object that describes this clip’s transformation

  • Clip._cachedSerializeData.transformation
    This is what the editor uses to reset clips transformation after the project pauses.

  • Clip.x

    The x position of the object (Left to Right)

  • Clip.y

    The y position of the object (Up to Down)

  • Clip.scaleX

    The scale of the object on the x-axis

  • Clip.scaleY

    The scale of the object on the y-axis

  • Clip.rotation

    The rotation of the object (measured in degrees)

  • Clip.opacity

    The opacity of the object. 0 is completely transparent, 1 is completely opaque

Timeline
  • Clip.timeline

    The timeline of this Clip

  • Clip.activeFrame

  • Clip.activeLayer

  • Clip.currentFrameName

  • Clip.currentFrameNumber

  • Clip.gotoAndPlay(frame)

  • Clip.gotoAndStop(frame)

  • Clip.gotoNextFrame()

  • Clip.gotoPrevFrame()

  • Clip.play()

  • Clip.stop()

  • Clip.updateTimelineForAnimationType()

Parents
  • Clip.project

    The Wick.Project

  • Clip.parent

    The parent of this Clip. Usually a Wick.Frame

  • Clip.parentClip

    The Clip that this is contained in. If it has no parent Clip, it will return the project Clip.

  • Clip.parentFrame

    The Frame that this is contained in.

  • Clip.parentLayer

    The Layer that this is contained in

  • Clip.parentTimeline

    The Timeline that this is contained in

Children
  • Clip._children

    All the children of this object

  • Clip.namedChildren

  • Clip.activeNamedChildren

  • Clip.addObjects(objects)

Clones
  • Clip.clone()

    Creates a clone of this object, places it on the same frame, and returns a reference to it
    Returns a Wick.Clip that is the cloned object.

  • Clip.clones

    An array of every clone of an object

  • Clip.isClone

    Returns true if this is a clone

  • Clip.sourceClipUUID

    Probably the UUID of the object that this was cloned from.

Wick.Frame

Note: Scripts in Frames refer to this as the project clip

Uncategorized
  • Frame.identifier

    The name of the Frame given in the “Name” property of the inspector.

  • Frame.length

Parents
  • Frame.parentClip

    The Clip containing this object. Frames on the main timeline will return the project Clip.

  • Frame.parentFrame

    The Frame containing this object. Frames on the main timeline will return null.

  • Frame.parentLayer

    The Layer containing this object.

  • Frame.parentTimeline

    The Timeline containing this object.

  • Frame.remove()

    Removes this Frame

Children
  • Frame._children

    The children of this Frame. They will include clips, paths, and text objects.

  • Frame.clips

    The clips and text contained in this Frame.

  • Frame.paths

    The paths contained in this Frame

  • Frame.addClip(clip)

  • Frame.removeClip(clip)

  • Frame.addPath(path)

  • Frame.removePath(path)

Sound
  • Frame.sound

  • Frame.soundEndMS

  • Frame.soundStart

  • Frame.soundStartMS

  • Frame.soundLoop

  • Frame.soundVolume

  • Frame.playSound()

  • Frame.stopSound()

  • Frame.removeSound()

  • Frame.isSoundPlaying()

Tweens
  • Frame.addTween(tween)

  • Frame.removeTween(tween)

I will add more docs, like for projects, bounds, e.t.c, later.

9 Likes

Good news, we have a BIG Update coming to Wick Documentation (with examples) for each API method! We’ll also be looking for some community input and additions soon, so this could be a big help!

4 Likes

wow, that’s a lot

2 Likes

Also, I think that I didn’t see them, but these are very useful…

clip.currentFrameName
clip.currentFrameNumber

3 Likes

Definitely need to add these in… Thanks for the reminder.

2 Likes

Said this before, but it’s relevant to this. I kinda want the following things if possible, from high priority to low:

  1. stopSound(assetName)
    Reason: There is no way to stop an individual sound. However, it may cause issues if one sound is playing twice, don’t know about that.
  2. fadeSound(assetName, startVolume, endVolume, fadeDuration)
    (Possibly confusing) Parameters:
    fadeDuration: The time, in frames, it takes for the volume to go from startVolume to endVolume.
    Reason: Fading’s… just not a thing, and having it would be cool.
  3. changeVolume(assetName, newVolume)
    Reason: It’s just an easier way to change volume than using fadeDuration with fadeDuration as 0… or 1, not sure if it’s 0 or 1 for instant audio change. Maybe both.
2 Likes

I’m pretty sure those are all possible. Wick Editor uses Howler.js to play sounds. Howler has built-in functions for stopping individual sounds, changing sound volume, and fading sounds.

1 Like

Hey guys, now that I’m a regular I made this a wiki. So now you can add more docs without having to depend on me.

If you write console.log(this); in a default script of a clip/frame, and go to the developer console, you can access all the properties of that object, and if a property is an object, the properties of a property. On Chrome, it doesn’t show the functions, but to do that you write Wick.(Object class name, like Frame, Clip, Path, e.t.c.).prototype, it will list all the functions for that class on Chrome. Hopefully it does the same thing for Firefox. But I’m not sure about other browsers.

Please don’t vandalize.

2 Likes

Hi @pumpkinhead,

so, where is this wiki located? I cannot find a link?

Paul

1 Like

this topic should be pinned on top at least until an official and more documented wiki is released

1 Like

This is the wiki. Anyone can edit the original post.

1 Like

this wiki is nice and helpful, that the wick company MUST pin this. but it’s ok.
And if i knew web dev, i would even make a web for this.

Btw, good doc. was helpful

1 Like