SOURCE

console 命令行工具 X clear

                    
>
console
var canvas = document.getElementById('canvas');
var editor = new Editor(canvas);

const node = editor.text([
  {
      text: 'haha',
      timelineStart: 1,
      timelineStop: 2,
      options: {
        top: 100,
        left: 100,
        textStyle: {
          fontColor: '#000000',
          fontSize: 28,
        }
      }
  }
])

node.zIndex = 100;

const config = node.textArray[0];
config.text = 'haha';
config.timelineStart = 1;
config.timelineStop = 2;
config.options = {
  left: 100,
  top: 100,
  textStyle: {
    fontSize: 28,
    fontColor: '#000000',
    textAlign: 'start',
    textBaseline: 'top',
  },
};
node.timelineStart(1);
node.timelineStop(2);

node.connect(editor.output);
console.log(editor.toObject());
InitVisualisations(editor, 'timeline-canvas', 'current');
<div id=container>
      <canvas width="1280" height="720" id="canvas" style="width: 640px; height: 360px;"></canvas>
  </div>
  <p>
    <button id="play-button">play</button>
    <button id="pause-button">pause</button>
  </p>

  <p id="current"></p>
  <p>
      <canvas id="timeline-canvas" width="640", height="10"></canvas>
  </p>
html {
    font-family: monospace;
    color: #333;
    /* background-color: black; */
  }
  #current {
    font-size: 12px;
  }
  #canvas {
    width: 640px;
    height: 360px;
  }
  #canvas2 {
    width: 640px;
    height: 360px;
    position: absolute;
    left: 0px;
    top: 0px;
    z-index: 10;
  }
  #container {
    position: relative;
  }

  button {
    line-height: 1.499;
      position: relative;
      display: inline-block;
      font-weight: 400;
      white-space: nowrap;
      text-align: center;
      background-image: none;
      border: 1px solid transparent;
      cursor: pointer;
      user-select: none;
      height: 32px;
      padding: 0 15px;
      font-size: 14px;
      border-radius: 4px;
      color: rgba(0,0,0,0.65);
      background-color: #fff;
      border-color: #d9d9d9;
      outline: 0;
      transition: all .3s cubic-bezier(.645, .045, .355, 1);
  }

  button:hover {
    color: #40a9ff;
    background-color: #fff;
    border-color: #40a9ff;
  }

  button:active {
    color: #096dd9;
    background-color: #fff;
    border-color: #096dd9;
  }

  input {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 32px;
    line-height: 32px;
    outline: none;
    padding: 0 8px;
    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 50px;
}

本项目引用的自定义外部资源