p5 icon indicating copy to clipboard operation
p5 copied to clipboard

Setting size larger than resolution?

Open pikeas opened this issue 4 years ago • 3 comments

Describe the bug

size() values are silently restricted to the display's resolution.

To Reproduce

from p5 import *


def print_sizes():
    print(core.p5.sketch.physical_size[0], core.p5.sketch.physical_size[1])
    print(core.p5.sketch.size[0], core.p5.sketch.size[1])
    print(width, height)  # globals / builtins set by p5


def setup():
    size(4000, 4000)
    no_loop()
    print_sizes()


def draw():
    print_sizes()


if __name__ == "__main__":
    run()

Expected behavior Canvas can be larger than screen. Alternately, is there a way to write to an off-screen buffer as in Processing? I'd like to produce high res output suitable for printing.

System information:

  • p5 0.7.1 / Python 3.9.1 / macOS 10.15.7

pikeas avatar Dec 26 '20 21:12 pikeas

Thank you for submitting your first issue to p5py

github-actions[bot] avatar Dec 26 '20 21:12 github-actions[bot]

off-screen buffer is not yet supported in p5py, but it will be possible after #212.

tushar5526 avatar Dec 27 '20 07:12 tushar5526

off-screen buffer is not yet supported in p5py, but it will be possible after #212.

That looks great, I'm looking forward to checking it out!

In the interim, could p5 add a warning or error when a call to size exceeds the maximum value for either dimension?

pikeas avatar Dec 27 '20 17:12 pikeas