本文整理汇总了Java中de.lessvoid.nifty.tools.Color.getAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java Color.getAlpha方法的具体用法?Java Color.getAlpha怎么用?Java Color.getAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.lessvoid.nifty.tools.Color
的用法示例。
在下文中一共展示了Color.getAlpha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startGame
import de.lessvoid.nifty.tools.Color; //导入方法依赖的package包/类
public void startGame() {
//TODO: without a player one cannot start
String mapName = screen.findElementById("mapNameLabel").getRenderer(TextRenderer.class).getOriginalText();
List<Element> children = playerScrollPanelPanel.getChildren();
ArrayList<Player> players = new ArrayList<Player>();
for (int i = 0; i < children.size(); i++) {
Element child = children.get(i);
String name = child.findNiftyControl("player" + i + "TextField", TextField.class).getDisplayedText();
if (child.findElementById("player" + i + "Label").getRenderer(TextRenderer.class).getOriginalText().equals("AI:")) {
System.err.println("AI not implemented yet. " + name + " excluded from Players.");
continue;
}
Color colorNifty = screen.findElementById("color" + i).getRenderer(PanelRenderer.class).getBackgroundColor();
org.newdawn.slick.Color colorSlick = new org.newdawn.slick.Color(colorNifty.getRed(), colorNifty.getGreen(), colorNifty.getBlue(), colorNifty.getAlpha());
int team = Integer.parseInt(screen.findNiftyControl("team" + i, Button.class).getText().substring(5))-1;
players.add(new Player(name, colorSlick, team));
}
Player[] player = new Player[players.size()];
player = players.toArray(player);
NiftyMenu.startGame(new Controller(MapList.getInstance().getMap(mapName), player, "Conquest"));
}
示例2: convertColor
import de.lessvoid.nifty.tools.Color; //导入方法依赖的package包/类
private int convertColor(Color color){
int color2 = 0;
color2 |= ((int)(255.0 * color.getAlpha())) << 24;
color2 |= ((int)(255.0 * color.getBlue())) << 16;
color2 |= ((int)(255.0 * color.getGreen())) << 8;
color2 |= ((int)(255.0 * color.getRed()));
return color2;
}
示例3: convertColor
import de.lessvoid.nifty.tools.Color; //导入方法依赖的package包/类
private int convertColor(Color color) {
int color2 = 0;
color2 |= ((int) (255.0 * color.getAlpha())) << 24;
color2 |= ((int) (255.0 * color.getBlue())) << 16;
color2 |= ((int) (255.0 * color.getGreen())) << 8;
color2 |= ((int) (255.0 * color.getRed()));
return color2;
}