Relative Content

Tag Archive for p5.js

p5.js: Scaled points are round?

I’m drawing a 2D grid of cells in p5.js. I was using rect() but found it was simpler to draw point()s and scale() them. I’m surprised to find that scaled-up points are round as un-scaled points are single square pixels. Is there a way to have a scaled-up point() render as a rectangle?

program in p5js loads but displays a blank screen

I was working on a program yesterday (simple game) and when I tried to work on it after a break of around 2 hours, it suddenly started displaying a blank screen. And I don’t think its the program not loading, because

in p5 How to change scalling but keep text size in pixel

I change the scaling to print a geometrical shape. Next to it I print its name. I use the scaling to make the geometrical shape smaller or bigger. I want the text follow the geometrical shape. Therefore When I scale or translate the shape, I want the text to be scale or translate to. I just have to give the same coordinate than the shape to plot the name next to the shape.