p5js_gleam/bindings
Constants
Functions
pub fn background(
sketch_instance p: P5,
color color: String,
) -> P5
A binding to the p5.js background
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn circle(
sketch_instance p: P5,
x_center x_center: Float,
y_center y_center: Float,
diameter diameter: Float,
) -> P5
A binding to the p5.js circle
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn create_canvas(
sketch_instance p: P5,
width width: Float,
height height: Float,
) -> P5
A binding to the p5.js createCanvas
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn ellipse(
sketch_instance p: P5,
x_center x_center: Float,
y_center y_center: Float,
width width: Float,
height height: Float,
) -> P5
A binding to the p5.js ellipse
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn erase(
sketch_instance p: P5,
strength strength: Int,
edge_strength edge_strength: Int,
) -> P5
A binding to the p5.js erase
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn fill(
sketch_instance p: P5,
color_hex color_hex: String,
) -> P5
A binding to the p5.js fill
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn image(
sketch_instance p: P5,
image image: P5Image,
top_left_x top_left_x: Float,
top_left_y top_left_y: Float,
width width: Float,
height height: Float,
) -> P5
A binding to the p5.js image
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn line(
sketch_instance p: P5,
point1_x point1_x: Float,
point1_y point1_y: Float,
point2_x point2_x: Float,
point2_y point2_y: Float,
) -> P5
A binding to the p5.js line
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn load_font(
sketch_instance p: P5,
path path: String,
) -> P5Font
A binding to the p5.js loadFont
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn load_image(
sketch_instance p: P5,
path path: String,
) -> P5Image
A binding to the p5.js loadImage
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn no_erase(sketch_instance p: P5) -> P5
A binding to the p5.js noErase
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn no_fill(sketch_instance p: P5) -> P5
A binding to the p5.js noFill
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn no_stroke(sketch_instance p: P5) -> P5
A binding to the p5.js noStroke
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn quad(
sketch_instance p: P5,
point1_x point1_x: Float,
point1_y point1_y: Float,
point2_x point2_x: Float,
point2_y point2_y: Float,
point3_x point3_x: Float,
point3_y point3_y: Float,
point4_x point4_x: Float,
point4_y point4_y: Float,
) -> P5
A binding to the p5.js quad
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn rect(
sketch_instance p: P5,
top_left_x top_left_x: Float,
top_left_y top_left_y: Float,
width width: Float,
height height: Float,
) -> P5
A binding to the p5.js rect
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn square(
sketch_instance p: P5,
top_left_x top_left_x: Float,
top_left_y top_left_y: Float,
side_length side_length: Float,
) -> P5
A binding to the p5.js square
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn start_sketch(config: SketchConfig(a, b)) -> Nil
Starts a p5.js sketch with the given configuration.
pub fn stroke(
sketch_instance p: P5,
color_hex color_hex: String,
) -> P5
A binding to the p5.js stroke
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn stroke_weight(
sketch_instance p: P5,
weight weight: Int,
) -> P5
A binding to the p5.js strokeWeight
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text(
sketch_instance p: P5,
text text: String,
bottom_corner_x bottom_corner_x: Float,
bottom_corner_y bottom_corner_y: Float,
) -> P5
A binding to the p5.js text
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text_align(
sketch_instance p: P5,
horizontal horizontal: String,
vertical vertical: String,
) -> P5
A binding to the p5.js textAlign
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text_font(sketch_instance p: P5, font font: P5Font) -> P5
A binding to the p5.js textFont
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text_font_from_string(
sketch_instance p: P5,
font font: String,
) -> P5
A binding to the p5.js textFont
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text_size(sketch_instance p: P5, size size: Int) -> P5
A binding to the p5.js textSize
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn text_width(
sketch_instance p: P5,
text text: String,
) -> Float
A binding to the p5.js textWidth
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.
pub fn triangle(
sketch_instance p: P5,
point1_x point1_x: Float,
point1_y point1_y: Float,
point2_x point2_x: Float,
point2_y point2_y: Float,
point3_x point3_x: Float,
point3_y point3_y: Float,
) -> P5
A binding to the p5.js triangle
function. Takes a p5 instance and the function’s arguments and returns the p5 instance.