Difference between revisions of "P5js-DOM-Button"

From Digipool-Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Diese Beispiel it eine Erweiterung des Dom [https://p5js.org/examples/dom-input-and-button.html Examples] auf der p5js Homepage
+
Diese Beispiel ist eine Erweiterung des Dom [https://p5js.org/examples/dom-input-and-button.html Examples] auf der p5js Homepage
  
 +
<pre>
 
   myButton = createButton('submit');
 
   myButton = createButton('submit');
 
   myButton.position(input.x + input.width, 65);
 
   myButton.position(input.x + input.width, 65);
Line 8: Line 9:
 
   myButton.show();
 
   myButton.show();
 
   myButton.hide();
 
   myButton.hide();
 +
 +
  myButton.style('borderRadius', '8px');
 +
  myButton.style('borderStyle', 'solid');
 +
  myButton.style('outlineStyle', 'dashed');
 +
 
 +
  myButton.style('fontFamily', 'times');
 +
  myButton.style('fontStyle', 'italic');
 +
  myButton.style('fontSize', '64px');
 +
 
 +
  myButton.style('color', 'rgb(0,255,0)');
 +
  myButton.style('backgroundColor', 'rgb(0,155,0)');
 +
  myButton.style('borderColor', 'rgb(0,120,0)');
 +
 +
</pre>
 +
 +
Siehe auch [https://www.w3schools.com/jsref/dom_obj_style.asp w3schools HTML DOM Style Object]
  
 
<br>
 
<br>

Latest revision as of 15:28, 22 October 2022

Diese Beispiel ist eine Erweiterung des Dom Examples auf der p5js Homepage

  myButton = createButton('submit');
  myButton.position(input.x + input.width, 65);
  myButton.size(fSize * 3, fSize * 2);
  myButton.mousePressed(playPause);
  myButton.style('opacity', 0);
  myButton.show();
  myButton.hide();

  myButton.style('borderRadius', '8px');
  myButton.style('borderStyle', 'solid');
  myButton.style('outlineStyle', 'dashed');
  
  myButton.style('fontFamily', 'times');
  myButton.style('fontStyle', 'italic');
  myButton.style('fontSize', '64px');
  
  myButton.style('color', 'rgb(0,255,0)');
  myButton.style('backgroundColor', 'rgb(0,155,0)');
  myButton.style('borderColor', 'rgb(0,120,0)');

Siehe auch w3schools HTML DOM Style Object