1.Surface Surface extends Objectimplements Parcelable java.lang.Object ↳ android.view.Surface Class Overview Handle onto a raw buffer that is being managed by the screen compositor. 简单翻译: Surface是原始图像缓冲区(raw buffer)的一个句柄,而原始图像缓冲区是由屏幕图像合成器(screen c…
其实相当于MVC结构的三者关系:M(Surface).V(SurfaceView).C(SurfaceHolder) 1.Surface Handle onto a raw buffer that is being managed by the screen compositor. 简单翻译:Surface是原始图像缓冲区(raw buffer)的一个句柄,而原始图像缓冲区是由屏幕图像合成器(screen compositor)管理的.包含两层意思: (1)通过Surface(因为Surface…
2015-07-28 17:29:19 这一篇主要看看布局过程 一.布局过程肯定要不可避免的涉及到layout()和onLayout()方法,这两个方法都是定义在View.java中,源码如下: /** * Assign a size and position to a view and all of its * descendants * * <p>This is the second phase of the layout mechanism. * (The first is measur…
上篇写的动画示例其实算不上一个游戏,顶多算是利用pygame进行的图形操作,今天着手实现一个小游戏:传说哥大战剧毒术士.名字很玄乎,其实就是最简单的一个射击游戏.好了废话不多说,先上截图吧: 一.初始化程序和定义变量 import pygame import math import random # 1 - Initialize the game pygame.init() # prepare the variables width, height = 640, 480 screen=pygam…