Libgdx window add alpha action change the background actor alpha
现象:
Stage中包括一个Window,一个Actor,Window中加入alpha action后,Actor也随之消失;Actor加入alpha action后,不起作用。
解决:
重写draw方法,加入batch.setColor(getColor().r, getColor().g, getColor().b, getColor().a);
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.secondegg.reversi.util.Assets; /**
*
* @author cuizhf
*/
public class Table extends Actor { public Table() {
} @Override
public void act (float delta) {
super.act(delta);
} @Override
public void draw (Batch batch, float parentAlpha) {
batch.setColor(getColor().r, getColor().g, getColor().b, getColor().a);
batch.draw(Assets.instance.table.tableh, 0, 0);
batch.draw(Assets.instance.table.tablen, 100, 0);
}
}
Libgdx window add alpha action change the background actor alpha的更多相关文章
- Add an Action that Displays a Pop-up Window 添加显示弹出窗口按钮
In this lesson, you will learn how to create an Action that shows a pop-up window. This type of Acti ...
- Add an Action with Option Selection 添加具有选项选择的按钮
In this lesson, you will learn how to create an Action with support for option selection. A new View ...
- UITableViewHeaderFooterView can't change custom background when loading from nib
down voteforite I've created a custom UITableViewHeaderFooterView and successfully load from nib int ...
- javascript改变背景/字体颜色(Through the javascript to change the background and font color)
鼠标移动到.移出DIV时修改DIV的颜色: 1.Change the font and Div background color--function <div style="width ...
- [SVG] Add an SVG as a Background Image
Learn how to set an SVG as the background image of an element. Background images can be resized by c ...
- UIkit复习:UIContorl及子控件的剖析
1.模块继承关系: 1.UIButton ->UIControl -> UIView 2.UILabel ->UIview 3.UIImageVie ...
- [libGDX游戏开发教程]使用libGDX进行游戏开发(12)-Action动画
前文章节列表: 使用libGDX进行游戏开发(11)-高级编程技巧 使用libGDX进行游戏开发(10)-音乐音效不求人,程序员也可以DIY 使用libGDX进行游戏开发(9)-场景过渡 ...
- Add a Simple Action using an Attribute 使用特性添加简单按钮
In the previous Add a Simple Action lesson, you learned how to add an Action by implementing the Vie ...
- Android设计和开发系列第二篇:Action Bar(Develop—Training)
Adding the Action Bar GET STARTED DEPENDENCIES AND PREREQUISITES Android 2.1 or higher YOU SHOULD AL ...
随机推荐
- redis在linux下安装并測试(在spring下调用)
官网帮助文档例如以下 Installation Download, extract and compile Redis with: $ wget http://download.redis.io/re ...
- SCU 4313 把一棵树切成每段K个点 (n%k)剩下的点不管
题目链接:http://cstest.scu.edu.cn/soj/problem.action?id=4313 判断是不是存在拆图得到新连通分支的点个数是K的倍数 注意一个点所连的边只能被切一条 # ...
- 查找文件工具find
与locate.whereis命令相比,find具有本质的区别: 首先,find是从指定的位置进行遍历查找(可以理解为对文件和目录进行逐一查找). 其次,find可以查找具有某一类特征的文件(例如查找 ...
- shiny安装使用入门
下载最新版R(至少3.2.5版本),在CRAN上下载: 打开R install.packages("shiny")#安装shiny包 library(shiny)#如果出现warn ...
- 【Linux】cp命令
用途 cp除了复制功能之外还可以建立快捷方式 全称 cp的全称为copy 参数 -a :相当于同时指定参数pdr -d :若文件为链接文件的属性(link file),则复制链接文件属性而非档案本身 ...
- Spring 基于xml配置方式的AOP
我们具体用代码来说明: 1.ArithmeticCalculator.java package com.proc; public interface ArithmeticCalculator { in ...
- Android传感器开发
2013-07-02 Android 中传感器的种类 加速度,Sensor.TYPE_ACCELEROMETER 陀螺仪,Sensor.TYPE_GYROSCOPE 亮度,Sensor.TYPE_LI ...
- c#:treeview双击某个节点的事件
NodeMouseDoubleClick事件 事例: private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseC ...
- springmvc验证数据
1.引入jar包 com.springsource.javax.validation-1.0.0.GA.jar 规范(只是定义) hibernate-validator-4.1.0.Final.ja ...
- Ruby 和 Python 分析器是如何工作的?
你好! 我作为一名编写Ruby profiler的先驱,我想对现有的Ruby和Python profiler如何工作进行一次调查. 这也有助于回答很多人的问题:“你怎么写一个profiler?” 在这 ...