【问题标题】:Use mousePressed() function in p5js在 p5js 中使用 mousePressed() 函数
【发布时间】:2021-04-12 23:25:41
【问题描述】:
//stroke weight
let strokeweight_driver = sin(millis()/300)
stroke_weight = map((strokeweight_driver), -1, 1, 5, 8)
stroke("black")
strokeweight(stroke_weight)
circle(20,30,20)

当我点击屏幕时,我想在 20 内制作这个圆的笔画重量。 所以我决定使用 mousePressed 函数并输入 stroke_weight = 20 但它不起作用。 我应该怎么办? p.s.英语不是我的母语,所以可能有一个错误的句子。请理解我。

【问题讨论】:

    标签: javascript visual-studio-code p5.js


    【解决方案1】:

    没有 strokeweight() 函数。它是strokeWeight()。 试试这个:

    stroke_weight = map((strokeweight_driver), -1, 1, 5, 8)
    stroke("black")
    strokeWeight(stroke_weight)
    circle(20,30,20)```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-02
      • 2021-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多