Comments (14)
Maybe I fixed this bug in 0.7.6.
Can anyone try it out?
Specifically, I changed the rendering position of each element by 0.5 pixel in OpenGL shader.
As a result of it, the edge region should also be treated as pixels regardless of environment. Probably.
from pyxel.
I'm having the same problem.
Sample program showcasing the bug:
import pyxel
class App:
def __init__(self):
pyxel.init(160, 128)
pyxel.run(self.update, self.draw)
def update(self):
pass
def draw(self):
pyxel.cls(0)
pyxel.rectb(20, 20, 100, 100, 7)
App()
Same effect with rect
, blt
or cls
, the last pixel column is not drawn.
Linux Debian 9, python 3.5.3
from pyxel.
The code @Stenodyon posted is working perfectly for me.
- pyxel 0.7.2
- python 3.7.0
- macOS 10.13.6
from pyxel.
The code posted by @Stenodyon works for me on:
- pyxel 0.7.0
- Python 3.7.0
- Windows 10 (1803)
But here:
import pyxel
class App:
def __init__(self):
pyxel.init(160, 128)
pyxel.run(self.update, self.draw)
def update(self):
pass
def draw(self):
pyxel.cls(0)
pyxel.rectb(0, 127, 20, 116, 7)
pyxel.rectb(0, 127, 20, 120, 3)
App()
It shows only first rectangle and I have no idea why, maybe it is related.
from pyxel.
Hello,
My setup is the following:
- Pyxel 0.7.3
- Python 3.6.6
- Arch Linux
The examples 03_draw_api.py
and 04_sound_api.py
shows the same bug as @ponponboy.
04_sound_api.py
segfaults right after being launched.
The two test codes by @Stenodyon and @golebiewsky show incorrect behaviour.
Since @carlsmith and @golebiewsky report no incorrect behaviour for the built-in example while using Python 3.7.0, I'll wait for Arch Linux to update Python from 3.6.6 to 3.7.0 before drawing any conclusion.
Screenshots
03_draw_api.py
04_sound_api.py
Test code from @Stenodyon
Test code from @golebiewsky
from pyxel.
I tried @golebiewsky's code, and it works fine for me (same specs as my last post).
from pyxel.
I got an pixel-error dependant on the screen size set in pyxel.init()
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)
- Win10,
- Python 3.6.2
- pyxel 0.7.4
from pyxel.
Pyxel uses the point sprites of OpenGL to improve the rendering performance.
And rendering area for each drawn object is specified as the size of point sprites.
So I think this bug is caused by the difference of OpenGL implementation.
from pyxel.
I will write a bit more.
Pyxel draws each element as point sprite of OpenGL. And to improve rendering performance, rendering area of each element is specified as the size of point sprite.
For examples, if the type of an element is pix
, the size will be set as 1. In the case of rect
, if the size of it is 40x30, the size will be set as 40 because allowed point sprite shape in OpenGL is only square.
So regarding this bug, it seems that some environment (depends on graphics driver?) decrease the point sprite size by 1. So pix
and the longer edge of rect
are not drawn.
For now, I don't have smart idea to fix this. Does anyone have good idea?
from pyxel.
Can anyone who faces this bug try to change the shaders.py l.54 from gl_PointSize = 1.0;
to gl_PointSize = 1.1;
and run the example #3 (draw api sample)?
I would like to know the pix
api works or not by this change.
from pyxel.
0.7.6 fixed the bug for me, thanks!
from pyxel.
Thank you for checking it!
from pyxel.
I confirm that, on my setup, release 0.7.6 fixed the bug.
from pyxel.
looks perfect!
thanks kitao! ;D
from pyxel.
Related Issues (20)
- ImportError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory HOT 4
- [Feature request] Implement an equivalent method to Pico 8 Load() HOT 3
- When I run an HTML application with ver 2.0, the assets file does not load properly. HOT 3
- Pyxel edit crashes upon cursor entering with EXC_BAD_ACCESS (SIGBUS) HOT 5
- demo of 30 Seconds Of Daylight is crashing HOT 2
- Pyxel 2.0.0 displays only black screen on Raspberry Pi HOT 12
- Confusion with `blt` function HOT 7
- Unable to import classes from different files using https://kitao.github.io/pyxel/wasm/launcher/?run= HOT 6
- palette only 0..254 (v2.0.2) HOT 2
- mouse_wheel never become 0 HOT 3
- Pyxel Editor crash when selecting Music Editor HOT 6
- Non pixel perfect pixels on the right side of the screen HOT 29
- Pyxel not running HOT 4
- Pyxel crash when starting edit or hello world example HOT 1
- Don't start when I ask for
- command for the terminal didn't work (pycharm) HOT 2
- Slide sound effect only works once HOT 4
- Unable to build a pyxel to exe application on a drive other than C:/ on Windows. HOT 1
- pyxel edit で音符マークを押したら music_editor.py の インデックスエラーで異常終了する。 HOT 1
- `pyxel.sqrt(0)` returns 1.7976931348623157e+308 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxel.