Skip to content

Commit 9fd4443

Browse files
committed
Interleave example between other docs
1 parent d1f33db commit 9fd4443

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/image/loading_displaying.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,26 @@ function loadingDisplaying(p5, fn){
854854
* destination image's top left corner. See
855855
* <a href="#/p5/imageMode">imageMode()</a> for other ways to position images.
856856
*
857+
* ```js, example
858+
* let img;
859+
*
860+
* // Load the image.
861+
* function preload() {
862+
* img = loadImage('assets/laDefense.jpg');
863+
* }
864+
*
865+
* function setup() {
866+
* createCanvas(100, 100);
867+
*
868+
* background(50);
869+
*
870+
* // Draw the image.
871+
* image(img, 0, 0);
872+
*
873+
* describe('An image of the underside of a white umbrella with a gridded ceiling above.');
874+
* }
875+
* ```
876+
*
857877
* Here's a diagram that explains how optional parameters work in `image()`:
858878
*
859879
* <img src="assets/drawImage.png"></img>
@@ -907,28 +927,6 @@ function loadingDisplaying(p5, fn){
907927
* background(50);
908928
*
909929
* // Draw the image.
910-
* image(img, 0, 0);
911-
*
912-
* describe('An image of the underside of a white umbrella with a gridded ceiling above.');
913-
* }
914-
* </code>
915-
* </div>
916-
*
917-
* <div>
918-
* <code>
919-
* let img;
920-
*
921-
* // Load the image.
922-
* function preload() {
923-
* img = loadImage('assets/laDefense.jpg');
924-
* }
925-
*
926-
* function setup() {
927-
* createCanvas(100, 100);
928-
*
929-
* background(50);
930-
*
931-
* // Draw the image.
932930
* image(img, 10, 10);
933931
*
934932
* describe('An image of the underside of a white umbrella with a gridded ceiling above. The image has dark gray borders on its left and top.');

0 commit comments

Comments
 (0)