当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Create a menu home screen for piTFT using pygame

问题描述:

I would like to create a home screen(menu) for my project using pygame(?).

I have a piTFT 2.8" Capactive display from adafruit.

I have design the whole display menu. Take a look on this demo screen for example:

Now I would like to built this on my pi. is there any easy way to position each element as can be seen on the attached image?

The display is 320 x 240, and I think if I try position the elements blindly it will take a lot of time which in this case, I dont really have spare time to waste.

Have you got any other suggestions about the use of pygame? Would you suggest me something different?

网友答案:

This answer may be a bit general, but what I do to find each position is go to paint or some paint program and then I add markers where positions are, then I can select rectangles and find there positions. It would be hard to find the positions by itself just from that image. Do you have a mac, windows, linux?'

just paste your menu, into the paint program and draw rectangles around certain icons, after that just go to the top left of the rect and it will tell you the position, so you will get both the width, height, and position.

分享给朋友:
您可能感兴趣的文章:
随机阅读: