I m an absolute beginner at Android programming, so please bear with me :) For my simple game, I m drawing a 20 x 10 grid consisting of squares at the beginning. Within the game, I would need to draw a sprite right at the center of some of the squares. (analogous to a Checkers grid, with a chip at the center of each square). I want this game to work across various screen sizes and densities. My approach has been to get the canvas width and height at the beginning of the game, calculate the side of the squares and then draw the grid out and save that as a bitmap, and then use that bitmap in the game. That way my grid would scale perfectly across screens.
(1) 是否有更好的办法? 曼 谷 我用电网的形象来替代地图吗? 我担心的是,当图像被提升到不同的屏幕上时,广场可能会被歪曲。 除此以外,很难计算每个面积面积面积的面积(放置间谍)。
2) 在屏幕上的某些地方,我还需要展示标题、分数、级别等。 是否最好将空间留给轨道图上,然后在轨道图上写记分,还是用水面电线和我写记分、等级等的另一种观点来绘制布局?
感谢!