现象:

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. easyui datagrid 分页保持checkbox选中状态

    刚开始我一直迷迷糊糊的写了很久,发现其实很简单 先给大家看看我的笨办法 var checkedItems = []; function ischeckItem() { for (var i = 0; ...

  2. css换行缩进

    1.换行缩进 <div id="alertiframe"> <span id="closeiframe">×</span> ...

  3. eclipse插件之easyshell

    在eclipse marketplace可以找到这个插件,名字就是easyshell,下载安装完以后,可以通过配置快捷键实现: enjoy it.

  4. Project has no project.properties file! Edit the project properties to set one.

    解决办法: 右击项目,选择android tools-->fix project properties.然后重启eclipse即可.

  5. 使用select处理任意数目个客户的单进程程序

    改写http://www.cnblogs.com/nufangrensheng/p/3587962.html中的TCP回射服务器程序,把它重写成使用select来处理任意数目个客户的单进程程序,而不是 ...

  6. servlet request getQueryString 汉字的URI编码如何转码

    JavaScript中编码有三种方法:escape.encodeURI.encodeURIComponent,地址栏中那些%XX就是汉字对应的字节被encodeURI编码格式转了.一个字节对应一个% ...

  7. Android 图片混排富文本编辑器控件

    概述 一个Android 图片混排富文本编辑器控件(仿兴趣部落) 详细 代码下载:http://www.demodashi.com/demo/12032.html 一.一个Android 图片混排富文 ...

  8. hdu 4742 Pinball Game 3D(三维LIS&amp;cdq分治&amp;BIT维护最值)

    Pinball Game 3D Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  9. soap 1.1 访问服务

    访问http://www.webxml.com.cn/zh_cn/web_services_item.aspx?id=494536374B66307964534D3D 可以获取一些外网提供的服务. 例 ...

  10. python --特殊方法与多范式

    转自:http://www.cnblogs.com/vamei/archive/2012/11/19/2772441.html Python一切皆对象,但同时,Python还是一个多范式语言(mult ...