pls
Junior Member

Posts: 24
|
Post by pls on Jun 15, 2018 13:15:55 GMT -8
Hi, I just got my new 7" screen and it looks great. You did a great job on the layout I might suggest that you put the connector for the arduino in the center of the display, but I am nitpicking.
To test the new display I modified a little program I made for the 4.5" display. I ran into a problem on the right side of the screen. It appears that when the sprites that I am using go beyond about y = 600 the sprite does not display on the screen. I am using the readout from the serial port showing touch screen coordinates.
I assume that there might be a some parameter that I am not setting. I am sending the Code and the Sprites I am using.
Thanks for making a great product.
pls
Attachments:space.gd2 (14.89 KB)
space.h (2.33 KB)
Peter_Space4-7.ino (3.92 KB)
|
|
pls
Junior Member

Posts: 24
|
Post by pls on Jun 15, 2018 14:57:12 GMT -8
Hi, I forgot to tell you, touch the left of the screen to move the ship left. Touch the right screen area to move the ship right. Press the center of the screen to fire the lasers. pls
|
|
|
Post by jamesbowman on Jun 15, 2018 16:10:05 GMT -8
Cool! Thanks for posting the code. The issue is that the hardware's Vertex2ii() drawing command only has a range of 0-511 pixels in X and Y. This wasn't an issue on 480x272 screens, of course! Instead Vertex2f() can be used, which has a much larger range. So I added a new function "sprite" which draws a sprite this way: void sprite(int x, int y, byte handle) { GD.BitmapHandle(handle); GD.Vertex2f(x << 4, y << 4); } and replaced every Vertex2ii() with a call to sprite(). Revised version attached. Peter_Space4-7.ino (3.98 KB)
|
|
pls
Junior Member

Posts: 24
|
Post by pls on Jun 15, 2018 18:22:49 GMT -8
Thanks for the quick fix. pls
|
|