现象:

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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. UITableViewHeaderFooterView can't change custom background when loading from nib

    down voteforite I've created a custom UITableViewHeaderFooterView and successfully load from nib int ...

  4. 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 ...

  5. [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 ...

  6. UIkit复习:UIContorl及子控件的剖析

    1.模块继承关系: 1.UIButton        ->UIControl  -> UIView 2.UILabel          ->UIview 3.UIImageVie ...

  7. [libGDX游戏开发教程]使用libGDX进行游戏开发(12)-Action动画

    前文章节列表:  使用libGDX进行游戏开发(11)-高级编程技巧   使用libGDX进行游戏开发(10)-音乐音效不求人,程序员也可以DIY   使用libGDX进行游戏开发(9)-场景过渡   ...

  8. 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 ...

  9. Android设计和开发系列第二篇:Action Bar(Develop—Training)

    Adding the Action Bar GET STARTED DEPENDENCIES AND PREREQUISITES Android 2.1 or higher YOU SHOULD AL ...

随机推荐

  1. ajax交互Struts2的action(1)

    1.客户端网页代码 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://w ...

  2. python 网络请求类库 requests 使用

    python 网络请求类库 requests 使用 requests是 为python封装的强大 REST 操作类库 githubhttps://github.com/kennethreitz/req ...

  3. SQL SERVER: 合并相关操作(Union,Except,Intersect)

    SQL SERVER: 合并相关操作(Union,Except,Intersect) use tempdb create table tempTable1 (id int primary key id ...

  4. 〖Linux〗(2013.08.02)使用ctag+cscope查看Android源代码

    1. 安装ctags和cscope sudo apt-get install -y exuberant-ctags cscope 2. vimrc中的配置 """&quo ...

  5. linux内核——进程切换宏switch_to

    该宏有三个参数:prev, next, last.它们都是局部变量. prev:输入参数,变量值为旧进程描述符的地址. next:输入参数,变量值为新进程描述符的地址. last:输出参数,用来记录该 ...

  6. 打通前后端全栈开发node+vue进阶【课程学习系统项目实战详细讲解】(3):用户添加/修改/删除 vue表格组件 vue分页组件

    第三章 建议学习时间8小时      总项目预计10章 学习方式:详细阅读,并手动实现相关代码(如果没有node和vue基础,请学习前面的vue和node基础博客[共10章] 演示地址:后台:demo ...

  7. 转:Mosquitto用户认证配置

    转自:https://blog.csdn.net/u012377333/article/details/69397124?utm_source=blogxgwz1 前言:基于Mosquitto服务器已 ...

  8. Android 使用Post方式提交数据

    在Android中,提供了标准Java接口HttpURLConnection和Apache接口HttpClient,为客户端HTTP编程提供了丰富的支持. 在HTTP通信中使用最多的就是GET和POS ...

  9. C#:文件操作(待补充)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...

  10. Python 列表 list() 方法

    描述 Python 列表 list() 方法用于将可迭代对象(字符串.列表.元祖.字典)转换为列表. 注:元组与列表是非常类似的,区别在于元组的元素值不能修改,元组是放在括号中,列表是放于方括号中. ...