Cannot understand the behavior
darxtrix opened this issue · comments
I am using npyscreen to draw GUI like this :
https://raw.githubusercontent.com/MrRio/vtop/master/docs/example.gif
I need to set the size of the canvas and then blit pixels on it accordingly.
But, when I do this :
>>> c = Canvas()
# how to set canvas size ?
>>> c.set(100,20)
>>> print(c.frame())
⠁
It prints a dot at start, I want it to print at the desired location i.e x=100 and y=20.
How can I achieve the behavior I am looking for.
Thanks.
Well, figured out this by digging into the code.
>>> print(c.frame(0,0,110,50))
did the job for me.
Thanks !
Python drawille displays the pixels in relative positioning by default. You can specify the frame's min/max coords by passing min_x
, min_y
, max_x
, max_y
numbers to it, so print(c.frame(min_x=0, min_y=0))
can do the desired behavior.
Oh ! I guess you replied at the sametime 😃 . Nevermind thanks !
=)