Closed BroMarduk closed 5 years ago
I'm working on this...
Working as excepted?
In 3d930d6
And b734b19
And 3a7795e9
I think the parameters are swapXY (or swapAxes), invertX, invertY.
Swap X axis with Y axis is a single operation and would be done when the event queue is parsed into the event. Invert X axis and Invert Y are independent and would be done when we calculate the position.
The naming goes along with what I have seen in the Adafruit and other screen dtoverlays
https://github.com/adafruit/Adafruit-PiTFT-Helper/blob/master/adafruit-pitft-helper
Oops, my fail :)
Finished, but must I swap and invert rel? I think so but I'm not sure.
Hello? @BroMarduk
If I set invertx=True , then x is always returned as 0
For example in sdl.py in Raspberry-Pi-Testing, changing pitft = pigame.PiTft() to pitft = pigame.PiTft(invertx = True) causes x to always be returned as zero by pygame.mouse.get_pos()
# To invert x, you need to subtract x from the screen_width screen_width, screen_height = pygame.display.get_surface().get_size() x = screen_width - x
I got sdl.py in Raspberry-Pi-Testing working for my PiTFT 320x240 (EDIT by nift4: 2.8") capacitive by changing pigame.py:
Oops, I'm banana :/
I hope it works now, I think swapxy works because it's readed before writing (Python first builds the dictoniary and least but not last it assigns it to the variable)
@gmeader Please post details about your workaround in #17
Tested it, works
Add parameter to the initialization to support swapped and inverted axes. There are times when other software would require a display to be configured in a non-standard manner and adding these parameters would give a way to allow pigame to run in these configurations.