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 ...
随机推荐
- 【树莓派】-bash: /usr/local/java/jdk1.8.0_161/bin/java: cannot execute binary file: Exec format error
遇到这样的问题:-bash: /usr/local/java/jdk1.8.0_161/bin/java: cannot execute binary file: Exec format error ...
- vb.net Bitmap Drawing
Public Class Form1 Dim BMP As New Drawing.Bitmap(640, 480) Dim GFX As Graphics = Graphics.FromImage( ...
- 算法笔记_032:最长回文串(Java)
目录 1 问题描述 2 解决方案 2.1 中心扩展法 2.2 Manacher算法 1 问题描述 给定一个字符串,求它的最长回文子串的长度. 2 解决方案 2.1 中心扩展法 此处,首先枚举出回文 ...
- volist 自增序号 分页如何实现?
TP框架模板中如何生成自增数据 {$_GET['p']*10-10+$i} /* 分页序号计算 */ function addnum($k,$num){ return ($k +1 ) ...
- MySQL主从架构之Master-Slave-Slave级联
Master-Slave-Slave级联 配置结果同上一小节是一样的 注意:默认情况下,从库执行relay-log中的SQL语句不会记录到BINLOG. 所以,处于中间层的MySQL配置项需要额外开启 ...
- chrome 禁止自动更新
禁止chrome自动更新 CreateTime--2017年7月4日09:07:01Author:Marydon 版本号:59.0.3071.115 x64 第一步:禁止Google更新服务 参考 ...
- 让zend studio 支持 redis函数自动提示
phpredis作者https://github.com/nicolasff/phpredis 写了文档https://github.com/ukko/phpredis-phpdoc上面提到了如何让e ...
- LaTeX去掉默认显示日期时间
LaTeX去掉默认显示日期时间: \date{}
- C#获取文件的md5
上代码: //获取MD5 public static string GetMd5Hash(String input) { if (input == null) { return null; } MD5 ...
- IIS发布.net core mvc web站点
这里只有操作步骤! 第一.查看IIS是否安装了 AspNetCoreModule,查看路径:IIS->模块 查看 安装步骤 下载网址:https://www.microsoft.com/net/ ...