Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个 android 应用程序,更具体地说是一个 tamagochi。为此,我需要创建一个像素化界面。如何模拟“大像素”以及如何为“大像素”设置动画?
据我所知,没有开箱即用的 API。构建自己的系统应该相当简单。
我会将实际的低分辨率像素存储在 a 中Matrix,然后使用它在 View 的方法Matrix中绘制矩形。onDraw此绘图涉及一些非常简单的数学运算,用于计算屏幕上“大像素”(矩形)的位置和大小。
Matrix
onDraw