博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
khan academy js
阅读量:4876 次
发布时间:2019-06-11

本文共 2521 字,大约阅读时间需要 8 分钟。

  • Documentation

Quick Jump: , , , , , , , , , , , ,  

ProcessingJS

Shapes

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

See also: , , , , , , , , , 

Complex Shapes

  •  
  •  
  •  

See also: , 

Colors

  •  
    Set the background color
  •  
    Set the fill color for shapes
  •  
    Turn off fill for shapes
  •  
    Set the outline color for shapes
  •  
    Change the thickness of lines and outlines
  •  
    Turn off outlines for shapes
  •  
    Store a color in a variable
  •  
    Blend two colors together
  •  
    Find color between 2 colors

See also: , , , , , , , 

Text

  •  
    Draw some text
  •  
    Changes the font of text
  •  
    Change the size of text

See also: , , , , 

Transforms

  •  
    Rotate shapes by an angle
  •  
    Scale shapes in both dimensions
  •  
    Translate shapes by an offset

See also: , , 

Environment

  •  /  
    The size of the canvas
  •  
    Called repeatedly during program execution.
  •  
    Plays one of the allowed sounds.

See also: , ,  ,  / 

Mouse

  •  
    Current coordinates of the mouse
  •  
    Past coordinates of the mouse
  •  
    Which button is pressed
  •  
    Whether mouse is being pressed
  •  
    Called when mouse is clicked
  •  
    Called when mouse is pressed
  •  
    Called when mouse is released
  •  
    Called when mouse is moved
  •  
    Called when mouse is dragged
  •  
    Called when mouse moves over canvas
  •  
    Called when mouse moves out of canvas

Keyboard

  •  
    Number representing which key is pressed
  •  
    Represents when a special key is pressed
  •  
    True if a key is being pressed, false otherwise
  •  
    Called when a key is pressed
  •  
    Called when a key is released
  •  
    Called when a key is typed

Math

  •  
    Generate a random number
  •  
    Calculates the distance between two points
  •  
    Constrain value between min and max
  •  
    Return the minimum of two numbers
  •  
    Return the maximum of two numbers
  •  
    Take the absolute value of a number
  •  
    Take the logarithm of a number
  •  
    Raise a number to an exponent
  •  
    Square a number
  •  
    Take the square root of a number
  •  
    Return nearest integer
  •  
    Return nearest integer of greater/equal value
  •  
    Return nearest integer of lesser/equal value
  •  
    An object that describes a 2-dimensional vector

See also: , , , , , , , 

Trigonometry

  •  
    Take the cosine of an angle
  •  
    Take the sine of an angle
  •  
    Take the tangent of an angle

See also: , , , , , , 

Date & Time

  • / /  
    Current date
  • / /  
    Current time
  •  
    Milliseconds elapsed since program start

Debugging

  •  
    Print to your browser's developer console
  •  
    Print to the canvas console
  •  
    Print to the canvas console

JavaScript

  •  
    Define a new function
  •  
    Only run code if a certain condition is true
  •  
    Only run code while a certain condition is true
  •  
    Repeat code a fixed number of times
  •  
    Make an array of 5 numbers

Our documentation does not cover the many ways to use JavaScript. Learn more at:

This reference is based on  and is licensed under the 

转载于:https://www.cnblogs.com/nbalive2001/p/5458157.html

你可能感兴趣的文章
PHP之abstract
查看>>
Rappid 消除试用版的弹出框
查看>>
精华 ionic入门之色彩、图标、边距和界面组件:列表
查看>>
顺变者昌
查看>>
Linux上vi(vim)编辑器使用教程
查看>>
promise intro2-用法
查看>>
极客范:如何使用 Cloud Insight 来监控闭路电视?
查看>>
Pytorch半精度浮点型网络训练问题
查看>>
Js操作Select大全
查看>>
java native method
查看>>
进入光云第一次做完项目的感受
查看>>
dns 视图
查看>>
[LeetCode] 合并K个排序链表
查看>>
leetcode--Balanced Binary Tree
查看>>
shell字符串处理
查看>>
js 数据绑定
查看>>
jsp的C标签一般使用方法以及js接收servlet中的对象及对象数字
查看>>
H5 简介
查看>>
window.frameElement的使用
查看>>
nl命令
查看>>