1、项目燃尽图
html
2、项目进展
[20172301郭恺第三天的进展]android
学习AS绘制牌桌,绘制玩家手牌,点击手牌断定弹出,刷帧线程,隐藏标题栏状态栏数据库
// 不显示状态栏 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); DisplayMetrics dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm); // 获得屏幕的长和宽 int screenWidth = dm.widthPixels; //水平分辨率 int screenHeight = dm.heightPixels; //垂直分辨率 picRes = BitmapFactory.decodeResource(this.getResources(), R.drawable.girl); // 获得图片的长和宽 picWidth = picRes.getWidth(); picHeight = picRes.getHeight(); // 计算缩放率,新尺寸除原始尺寸 float scaleWidth = ((float) screenWidth ) / picWidth; float scaleHeight = ((float) screenHeight ) / picHeight; // 建立操做图片用的matrix对象 Matrix matrix = new Matrix(); // 缩放图片动做 matrix.postScale(scaleWidth, scaleHeight); // 新获得的图片是原图片通过变换填充到整个屏幕的图片 Bitmap picNewRes = Bitmap.createBitmap(picRes, 0, 0,picWidth, picHeight, matrix, true);
首先,是要控制图片缩放的。
咱们小组设计的UNO卡牌游戏,游戏界面是经过绘制图片来显示。而且经过线程刷新牌组。
为了节约内存空间,咱们把全部的牌整合到一张图片上面。因此须要,截取图片的一部分。要计算每张牌的长和宽。post
Canvas
中有个方法。drawBitmap(Bitmap,Rect,Rect,Paint);
其中有两个Rect
,
第一个Rect 表明要绘制的bitmap 区域,第二个 Rect 表明的是要将bitmap 绘制在屏幕的什么地方
这样咱们,就能肯定,第一个Rect
绘制纸牌,第二个Rect
是肯定其位置。学习
[20172304段志轩第三天的进展]&博客this
[20172328李馨雨第三天的进展].net
[20172329王文彬第三天的进展]线程
[20172330李楠第三天的进展]设计
小伙伴 | 郭恺 | 段志轩 | 李馨雨 | 王文彬 | 李楠 |
---|---|---|---|---|---|
贡献量 | 6 | 3 | 3 | 5 | 3 |