processing实现canvas樱花树生长开花动画效果代码

代码语言:html

所属分类:动画

代码描述:processing实现canvas樱花树生长开花动画效果代码

代码标签: processing canvas 樱花树 生长 开花 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
  
<style>
* {
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

body {
  background: #e6e2ca;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
body canvas {
  box-shadow: 0.2em 0.2em 2em #0008;
  border: none;
  outline: none;
}
</style>


  
  
</head>

<body translate="no">
  <canvas id="canvas"></canvas>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/processing.1.4.8.js"></script> 

<script>
var sketchProc = function(processingInstance) {
  with (processingInstance) {
    size(600, 600); 
    frameRate(60);    
    smooth();
    
textAlign(CENTER, CENTER);
textSize(25);
strokeCap(PROJECT);

//used for controlling the animation
var lenBranches = 0, lenLeaves = 0, lenFlowers = 0;

//define the tree object/properties
var.........完整代码请登录后点击上方下载按钮下载查看

网友评论0