pyxel.cls(0) is not clearing the screen properly for some resolutions
See original GitHub issueSome pixels do not get overwriten(/overdrawn) on some resolutions.
import pyxel
class MyGame:
def __init__(self):
pyxel.init(100,100)
self.x = 0
pyxel.run(self.update, self.draw)
def update(self):
self.x = (self.x + 1) % pyxel.width
def draw(self):
pyxel.cls(0)
pyxel.rect(self.x,0,self.x+7,7,9)
MyGame()
this code leads to this result:
but if I change the pyxel.init() to
pyxel.init(100,101)
the result is fine:
This code shows how the bottom and right border aren’t drawn properly
import pyxel
class MyGame:
def __init__(self):
pyxel.init(100,100)
self.x = 0
pyxel.run(self.update, self.draw)
def update(self):
self.x = (self.x + 1) % pyxel.width
def draw(self):
pyxel.cls(13)
pyxel.rect(self.x,0,self.x+7,7,9)
MyGame()
- Win10,
- Python 3.6.2
- pyxel 0.7.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
tkinter not recognizing screen resolution correctly
I believe the default DPI for Tkinter is 72, my screen being 15.6 inch would have 282 DPI. Most probably you have some...
Read more >BRL.Max2D - BlitzMax
Clears the graphics buffer to the current cls color as determined by SetClsColor. ... Not drawing the last pixel can be useful if...
Read more >Leica Application Suite - LAS User Manual - STLCC.edu
When the Leica Application Suite is first installed on the computer, all of the Optional Modules are also installed but not enabled. Selecting...
Read more >CHIP-8 in Common Lisp: Graphics - Steve Losh
Video Memory and Performance; Fonts; Clearing the Screen: CLS ... The CHIP-8 has a 64x32 pixel display, and each pixel has only two...
Read more >PICO-8 manual - Lexaloffle Games
If a pixel-wise selection is not present, many operations are instead ... not specified, the current colour is set to 6 cls [col]...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now I understood the cause. It’s the limitation of the point sprite size of OpenGL. It’s limited to 256 and Pyxel uses OpenGL point sprite to draw elements. So any element its size if over 256 is limited to 256. And
cls
is the same implementation asrect
. So this problem happens.It isn’t easy to remove this limitation on the current implementation. So please let this limitation as a specification of Pyxel for a while.
Hi, On SDL2 version of Pyxel, clipping is processed with pure software (not using OpenGL feature). So I don’t think this issue happen again on the latest version.
2019年7月2日(火) 12:06 Derek McCammond notifications@github.com: