diff --git a/examples/Libraries/Basics/Basics.rpde b/examples/Libraries/Basics/Basics.rpde new file mode 100644 index 0000000..7f8ecc0 --- /dev/null +++ b/examples/Libraries/Basics/Basics.rpde @@ -0,0 +1,23 @@ +settings <- function() { + importLibrary("peasycam") + size(200, 200, P3D) +} + +setup <- function() { + cam = PeasyCam$new(processing, 100) + cam$setMinimumDistance(50) + cam$setMaximumDistance(500) +} + +draw <- function() { + rotateX(-0.5) + rotateY(-0.5) + background(0) + fill(255, 0, 0) + box(30) + pushMatrix() + translate(0, 0, 20) + fill(0, 0, 255) + box(5) + popMatrix() +} diff --git a/examples/reference/importLibrary/.property.yml b/examples/reference/importLibrary/.property.yml new file mode 100644 index 0000000..e723b44 --- /dev/null +++ b/examples/reference/importLibrary/.property.yml @@ -0,0 +1,9 @@ +category: Library +subcategory: +description: " +Import Processing libraries. +" +syntax: " importLibrary(library)" +parameters: + - label: 'library' + description: "The name of the library." diff --git a/examples/reference/importLibrary/importLibrary0/importLibrary0.rpde b/examples/reference/importLibrary/importLibrary0/importLibrary0.rpde new file mode 100644 index 0000000..7f8ecc0 --- /dev/null +++ b/examples/reference/importLibrary/importLibrary0/importLibrary0.rpde @@ -0,0 +1,23 @@ +settings <- function() { + importLibrary("peasycam") + size(200, 200, P3D) +} + +setup <- function() { + cam = PeasyCam$new(processing, 100) + cam$setMinimumDistance(50) + cam$setMaximumDistance(500) +} + +draw <- function() { + rotateX(-0.5) + rotateY(-0.5) + background(0) + fill(255, 0, 0) + box(30) + pushMatrix() + translate(0, 0, 20) + fill(0, 0, 255) + box(5) + popMatrix() +} diff --git a/src/rprocessing/mode/RLangMode.java b/src/rprocessing/mode/RLangMode.java index 977e90d..4e8260d 100644 --- a/src/rprocessing/mode/RLangMode.java +++ b/src/rprocessing/mode/RLangMode.java @@ -100,7 +100,8 @@ public String[] getExtensions() { */ @Override public File[] getExampleCategoryFolders() { - return new File[] {new File(examplesFolder, "Basics")}; + return new File[] {new File(examplesFolder, "Basics"), new File(examplesFolder, "Libraries"), + new File(examplesFolder, "reference")}; } /**