screensaver.js 640 B

1234567891011121314151617181920212223242526272829
  1. function Screensaver(){
  2. this.enter = function()
  3. {
  4. console.log("ENTER SCREESAVER")
  5. textX = 10;
  6. textY = 0;
  7. }
  8. this.setup= function() {
  9. cnv=createCanvas(_w, _h);
  10. cnv.mouseClicked(toRiver);
  11. console.log("ScSv STARTED ")
  12. }
  13. this.draw = function() {
  14. let ourText='Click Over Me';
  15. background("teal");
  16. fill("black");
  17. textSize(50 + cos(frameCount * 0.025) * 25);
  18. textLeading(sin(frameCount * 0.01)*50);
  19. text(ourText, 40, height/2, 300, 350);
  20. }
  21. function toRiver(){
  22. console.log("Mouse pressed in ScSv")
  23. _mgr.showScene( River );
  24. }
  25. }