p5js_gleam/bindings
Functions
pub fn background(p: P5, 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(
p: P5,
x_center: Float,
y_center: Float,
radius: 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(p: P5, width: Float, 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(
p: P5,
x_center: Float,
y_center: Float,
width: Float,
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(p: P5, strength: Int, 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(p: P5, 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(
p: P5,
image: P5Image,
top_left_x: Float,
top_left_y: Float,
width: Float,
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(
p: P5,
point1_x: Float,
point1_y: Float,
point2_x: Float,
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(p: P5, 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(p: P5, 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(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(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(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(
p: P5,
p1_x: Float,
p1_y: Float,
p2_x: Float,
p2_y: Float,
p3_x: Float,
p3_y: Float,
p4_x: Float,
p4_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(
p: P5,
top_left_x: Float,
top_left_y: Float,
width: Float,
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(
p: P5,
top_left_x: Float,
top_left_y: Float,
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(p: P5, 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(p: P5, 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(
p: P5,
text: String,
bottom_corner_x: Float,
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_font(p: P5, 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(p: P5, 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.