Skip to content
loading...

How to use SVG on Processing(p5)

twitter logo github logo ・1 min read  

First of all, my sample program is here.

Prerequisites

You've installed Processing on your PC/Mac.
Also please get a SVG file to show.

How to

At first, you have to prepare PShape object.
After that, call the loadShape method.

PShape some_kind_of_shape;
some_kind_of_shape = loadShape("Some_Kind_of_Shape.svg");

Actually, I defined PShape variable as static in my sample code for simplicity.

After you've prepared the object properly, just calling shape method in draw method and you can see your svg.

void draw() {
  background(255);
  shape(some_kind_of_shape, position_x, position_y, shape_width, shape_height);
}
twitter logo DISCUSS (1)
markdown guide
 

This applies to Processing (Desktop) but not p5 (javascript variant of processing)

Classic DEV Post from Sep 1 '18

On Dealing with Anxiety and Depression as a Developer

I've dealt with anxiety and depression for most of my life. Its been a constant battle, both personally and professionally as a software developer. Here's a look into my journey and some things I've taken away from it so far.

Koji Toyota profile image
Asian software engineer.

By the community, for the community.

DEV is open source, and it's spectacular. It's also the fastest growing software community in the solar system.

Get started now ❤️