Get Viewport Width With JQuery and Use In Processing JS

前端 未结 1 1568
无人及你
无人及你 2021-02-11 02:29

I\'m writing a processingjs script that I want to resize depending on the users viewport width. As far as I know there\'s no functionality for this in processing, so I\'ve been

1条回答
  •  死守一世寂寞
    2021-02-11 03:07

    You can call $(window).width(); in the size function. Mixing js and p5 code is fine in processing.js.

    void setup() {
        size( $(window).width(),
            $(window).height() );
        ...
    }
    

    0 讨论(0)
提交回复
热议问题