private void initView() {
// 游戏背景
AnimatedSprite game_bg = new AnimatedSprite(0, 0, Res.GAME_BG,
getVertexBufferObjectManager());
this.attachChild(game_bg);
// 中间游戏主体部分
mGameGroup = new GameGroup(this);
// 设置改Group的中心位置在镜头的中心点上
mGameGroup.setCentrePosition(this.getCameraCenterX(),
this.getCameraCenterY());
this.attachChild(mGameGroup);
// 2048 LOGO
AnimatedSprite game_logo = new AnimatedSprite(20, 20, Res.GAME_LOGO,
getVertexBufferObjectManager());
this.attachChild(game_logo);
// 最佳得分背景
bestScoreBg = new AnimatedSprite(0, 20, Res.GAME_SCORE_BG_BEST,
getVertexBufferObjectManager());
// 设置bestScoreBg右边x坐标的位置在镜头的右边减20的位置
bestScoreBg.setRightPositionX(this.getCameraRightX() - 20);
this.attachChild(bestScoreBg);
tBestScore = new Text(0, bestScoreBg.getY() + 50,
FontRes.getFont(ConstantUtil.FONT_SCORE_NUM),
SharedUtil.getBestScore(getActivity()) + "", 4,
getVertexBufferObjectManager());
// 设置 tBestScore 的X坐标上的中点在bestScoreBg的X坐标中点上
tBestScore.setCentrePositionX(bestScoreBg.getCentreX());
this.attachChild(tBestScore);
// 当前得分背景
currScoreBg = new AnimatedSprite(0, bestScoreBg.getY(),
Res.GAME_SCORE_BG_NOW, getVertexBufferObjectManager());
// 设置currScoreBg的右边X坐标点在bestScoreBg左边的X坐标减20的位置上
currScoreBg.setRightPositionX(bestScoreBg.getLeftX() - 20);
this.attachChild(currScoreBg);
.....
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有