本文整理汇总了Java中org.andengine.util.color.Color类的典型用法代码示例。如果您正苦于以下问题:Java Color类的具体用法?Java Color怎么用?Java Color使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Color类属于org.andengine.util.color包,在下文中一共展示了Color类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Font
import org.andengine.util.color.Color; //导入依赖的package包/类
public Font(final FontManager pFontManager, final ITexture pTexture, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColorARGBPackedInt) {
this.mFontManager = pFontManager;
this.mTexture = pTexture;
this.mTextureWidth = pTexture.getWidth();
this.mTextureHeight = pTexture.getHeight();
this.mBackgroundPaint = new Paint();
this.mBackgroundPaint.setColor(Color.TRANSPARENT_ARGB_PACKED_INT);
this.mBackgroundPaint.setStyle(Style.FILL);
this.mPaint = new Paint();
this.mPaint.setTypeface(pTypeface);
this.mPaint.setColor(pColorARGBPackedInt);
this.mPaint.setTextSize(pSize);
this.mPaint.setAntiAlias(pAntiAlias);
this.mFontMetrics = this.mPaint.getFontMetrics();
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:19,代码来源:Font.java
示例2: animate
import org.andengine.util.color.Color; //导入依赖的package包/类
protected void animate(final WorldObject object, WorldObject.Animation animation) {
final Color toColor;
switch (animation) {
case VALID_HIT:
toColor = Color.GREEN;
break;
case INVALID_HIT:
toColor = Color.RED;
break;
case VALID_MISS:
toColor = Color.GREEN;
break;
default:
throw new IllegalStateException("THERE IS NO DEFAULT");
}
animate(object, Color.WHITE, toColor);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:20,代码来源:BaseGame.java
示例3: WorldObject
import org.andengine.util.color.Color; //导入依赖的package包/类
protected WorldObject(float pX, float pY, boolean touchable, @Nullable Float pScale,
ITiledTextureRegion pTiledTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager) {
if (pScale == null) {
pScale = SCALE_DEFAULT;
}
if (touchable) {
sprite = new TouchableAnimatedSprite(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager, this);
} else {
sprite = new TouchableAnimatedSprite(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager, null);
}
sprite.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
sprite.setScale(pScale);
sprite.setPosition(pX, pY);
defaultColor = new Color(sprite.getColor());
Log.d(TAG, "WorldObject - New " + this.getClass().getSimpleName() + " of scale " + pScale + " at " + pX + ", " + pY);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:17,代码来源:WorldObject.java
示例4: Key
import org.andengine.util.color.Color; //导入依赖的package包/类
public Key(Type type, PianoGame pGame) {
super(position(type, pGame.getActivity()).x, position(type, pGame.getActivity()).y, type, true, true, pGame.getActivity());
final float posX = position(type, pGame.getActivity()).x;
final float posY = position(type, pGame.getActivity()).y;
final float posShapeX = posX - sprite.getWidth() * SCALE_DEFAULT;
final float posShapeY = posY - (sprite.getHeight() / 4) * SCALE_DEFAULT;
final float posShaderX = posX - 6;
final float posShaderY = posY - 12;
game = pGame;
shape = new TouchableAnimatedSprite(posShapeX, posShapeY, sprite.getTiledTextureRegion(),
game.getActivity().getVBOM(), this);
shape.setColor(Color.TRANSPARENT);
shape.setRotation(sprite.getRotation());
shadowValid = new Sprite(posShaderX, posShaderY, game.getActivity().getTexture(ResMan.PIANO_SHADER_OK), game.getActivity().getVBOM());
shadowInvalid = new Sprite(posShaderX, posShaderY, game.getActivity().getTexture(ResMan.PIANO_SHADER_KO), game.getActivity().getVBOM());
hideShadows();
setMemberScales(SCALE_DEFAULT);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:21,代码来源:Key.java
示例5: defineRectangularHitbox
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* Set the hitbox relatively to the Sprite
*
* @param xmin left distance to the sprite
* @param ymin top distance to the sprite
* @param width width of the hitbox
* @param height height of the hitbox
* @return this so this call can be inline
*/
public SpriteComponent defineRectangularHitbox(float xmin, float ymin, float width, float height) {
//sprite.setColor(Color.RED);
hitbox = new Rectangle(xmin, ymin, width, height, sprite.getVertexBufferObjectManager());
if (GameActivity.DEBUG_MODE) {
hitbox.setVisible(true); // to set to false
hitbox.setAlpha(10); // DON'T WORK
hitbox.setColor(Color.BLUE);
} else {
hitbox.setVisible(false);
}
sprite.attachChild(hitbox);
return this;
}
开发者ID:Callilf,项目名称:RotatingSentries,代码行数:25,代码来源:SpriteComponent.java
示例6: LoadingScene
import org.andengine.util.color.Color; //导入依赖的package包/类
LoadingScene() {
super();
float spriteSTartY = (camera.getHeight() - camera.getWidth()) / 2;
setBackground(new Background(Color.BLACK));
this.attachChild(new Sprite(0, spriteSTartY, camera.getWidth(), camera.getWidth(),
ResourcesManager.getInstance().loadingScreenBackgroundRegion, vbom) {
@Override
protected void preDraw(GLState pGLState, Camera pCamera) {
super.preDraw(pGLState, pCamera);
pGLState.enableDither();
}
});
}
开发者ID:djschilling,项目名称:sopa,代码行数:18,代码来源:LoadingScene.java
示例7: initInfoMessageText
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* 戦闘ログテキスト初期化
*/
private void initInfoMessageText(IEntity entity) {
float width = getBaseScene().getWindowWidth() - (getBaseScene().getWindowWidth() / 10);
float height = 40;
Rectangle rectangle = getBaseScene().createRectangle(0, 0, width, height);
rectangle.setColor(Color.BLACK);
rectangle.setAlpha(0.5f);
rectangle.setZIndex(LayerZIndexType.TEXT_LAYER.getValue());
rectangle.setTag(INFO_MESSAGE_TEXT_TAG);
Text text = new Text(10, 10, getBaseScene().createFont(Typeface.DEFAULT, 20, Color.WHITE),
"000000000000000000000000000000000000000000000000000000000000000",
getBaseScene().getBaseActivity().getVertexBufferObjectManager());
rectangle.attachChild(text);
getBaseScene().placeToCenterX(rectangle, 10);
rectangle.setVisible(false);
entity.attachChild(rectangle);
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:23,代码来源:BattlePart.java
示例8: showPlayerTurnCutIn
import org.andengine.util.color.Color; //导入依赖的package包/类
@Override
public void showPlayerTurnCutIn(final List<Integer> playerSeqNoList, final ICutInCallback cutInCallback) {
showCutIn(MapBattleCutInLayerType.PLAYER_TURN_CUTIN, new ICutInCallback() {
@Override
public void doAction() {
for (Integer seqNo : playerSeqNoList) {
ActorSprite actorSprite = getActorSprite(seqNo);
actorSprite.setPlayerToDefaultPosition();
actorSprite.getPlayer().setColor(Color.WHITE);
}
cutInCallback.doAction();
}
});
// カットイン中に1番目のプレイヤーまで画面を移動する
int playerSeqNo = playerSeqNoList.iterator().next();
mapMoveToPlayer(playerSeqNo);
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:18,代码来源:SRPGPart.java
示例9: createPlayerSprite
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* プレイヤーキャラ描画.
* @param playerSeqNo
* @param imageId
* @param mapPoint
*/
private void createPlayerSprite(int playerSeqNo, ActorPlayerDto playerActor, MapPoint mapPoint, float size) {
ActorSprite player = new ActorSprite(playerActor, getBaseScene(), 0, 0, size, size);
player.setPlayerToDefaultPosition();
player.setPlayerSize(size, size);
player.setPlayerPosition(
mapPoint.getX() + (MapGridUtil.GRID_X / 2) - (player.getWidth() / 2) - (player.getWidth() / 8),
mapPoint.getY() + (MapGridUtil.GRID_Y / 2) - player.getHeight() + (player.getHeight() / 8));
player.setZIndex(LayerZIndexType.ACTOR_LAYER.getValue());
player.setTag(playerSeqNo);
getBaseMap().attachChild(player);
PlayerStatusRectangle playerStatusRect = getPlayerStatusRectangle(playerSeqNo);
if (playerStatusRect == null) {
playerStatusRect = initStatusWindow(player, 0);
playerStatusRect.setZIndex(LayerZIndexType.POPUP_LAYER.getValue());
playerStatusRect.setColor(Color.BLUE);
playerStatusRect.setAlpha(0.5f);
playerStatusRect.setTag(80000 + playerSeqNo);// TODO: TAG
getBaseScene().attachChild(playerStatusRect);
}
playerStatusRect.setVisible(false);
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:30,代码来源:SRPGPart.java
示例10: createEnemySprite
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* 敵キャラ描画.
* @param enemySeqNo
* @param enemyActor
* @param mapPoint
* @param size
*/
private void createEnemySprite(int enemySeqNo, ActorPlayerDto enemyActor, MapPoint mapPoint, float size) {
ActorSprite enemy = new ActorSprite(enemyActor, getBaseScene(), 0, 0, size, size);
enemy.setPlayerToDefaultPosition();
enemy.setPlayerSize(size, size);
enemy.setPlayerPosition(
mapPoint.getX() + (MapGridUtil.GRID_X / 2) - (enemy.getWidth() / 2) - (enemy.getWidth() / 8),
mapPoint.getY() + (MapGridUtil.GRID_Y / 2) - enemy.getHeight() + (enemy.getHeight() / 8));
enemy.setZIndex(LayerZIndexType.ACTOR_LAYER.getValue());
enemy.setTag(enemySeqNo);
getBaseMap().attachChild(enemy);
PlayerStatusRectangle enemyStatusRect = getPlayerStatusRectangle(enemySeqNo);
if (enemyStatusRect == null) {
enemyStatusRect = initStatusWindow(enemy, 0);
enemyStatusRect.setZIndex(LayerZIndexType.POPUP_LAYER.getValue());
enemyStatusRect.setColor(Color.RED);
enemyStatusRect.setAlpha(0.5f);
enemyStatusRect.setTag(80000 + enemySeqNo);// TODO: TAG
getBaseScene().attachChild(enemyStatusRect);
}
enemyStatusRect.setVisible(false);
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:31,代码来源:SRPGPart.java
示例11: initStatusWindow
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* ステータスウィンドウ初期化.
* @param actorSprite
* @param y
* @return
*/
private PlayerStatusRectangle initStatusWindow(ActorSprite actorSprite, float y) {
if (actorSprite == null) {
return null;
}
PlayerStatusRectangle playerStatusRectangle = new PlayerStatusRectangle(getBaseScene(),
getBaseScene().getFont(), actorSprite.getActorPlayer(),
ActorSpriteUtil.getFaceFileName(actorSprite.getActorPlayer().getImageResId()),
getBaseScene().getWindowWidth() / 2, y,
getBaseScene().getWindowWidth() / 2, getBaseScene().getWindowHeight() / 2);
playerStatusRectangle.setZIndex(LayerZIndexType.POPUP_LAYER.getValue());
CommonWindowRectangle commonWindowRectangle = new CommonWindowRectangle(
0, 0,
playerStatusRectangle.getWidth(),
playerStatusRectangle.getHeight() / 2,
Color.TRANSPARENT, 0.0f, getBaseScene());
playerStatusRectangle.attachChild(commonWindowRectangle);
return playerStatusRectangle;
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:25,代码来源:SRPGPart.java
示例12: createCursorSprite
import org.andengine.util.color.Color; //导入依赖的package包/类
/**
* カーソル描画.
* @param mapPoint
*/
private Sprite createCursorSprite(Point mapIndexPoint, Color color) {
PointF pointF = MapGridUtil.indexToDisp(new Point(mapIndexPoint.x, mapIndexPoint.y));
Sprite cursor = getBaseScene().getResourceSprite("grid128.png");
cursor.setColor(color);
cursor.setSize(MapGridUtil.GRID_X, MapGridUtil.GRID_Y);
cursor.setPosition(pointF.x, pointF.y);
cursor.registerEntityModifier(new LoopEntityModifier(new SequenceEntityModifier(
new AlphaModifier(0.5f, 0.2f, 0.6f),
new AlphaModifier(0.5f, 0.6f, 0.2f)
)));
getBaseMap().attachChild(cursor);
return cursor;
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:20,代码来源:SRPGPart.java
示例13: createTextRectangle
import org.andengine.util.color.Color; //导入依赖的package包/类
public Rectangle createTextRectangle(String titleStr, Font titleFont, String detatilStr, Font detailFont,
VertexBufferObjectManager pVertexBufferObjectManager) {
Text titleText = new Text(0, 0, titleFont, titleStr,
pVertexBufferObjectManager);
Text detatilText = new Text(0, 0, detailFont, detatilStr,
pVertexBufferObjectManager);
titleText.setPosition(0, 0);
detatilText.setPosition(titleText.getX() + titleText.getWidth(), titleText.getY());
float textWidth = titleText.getWidth() + detatilText.getWidth();
float textHeight = titleText.getHeight();
Rectangle resultRectangle = new Rectangle(0, 0, textWidth, textHeight,
pVertexBufferObjectManager);
resultRectangle.setColor(Color.TRANSPARENT);
resultRectangle.setAlpha(0.0f);
resultRectangle.attachChild(titleText);
resultRectangle.attachChild(detatilText);
return resultRectangle;
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:22,代码来源:TextLogic.java
示例14: initLayer
import org.andengine.util.color.Color; //导入依赖的package包/类
private void initLayer(KeyListenScene pBaseScene, String pText) {
// レイヤー作成
setColor(Color.BLACK);
setAlpha(0.7f);
setVisible(false);
setZIndex(LayerZIndexType.CUTIN_LAYER.getValue());
// フォント
Font titleFont = pBaseScene.createFont(Typeface.SANS_SERIF, 36, Color.WHITE);
// 表示テキスト
Text winConditionTitle = new Text(16, 16, titleFont,
pText,
new TextOptions(HorizontalAlign.CENTER),
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
pBaseScene.placeToCenter(winConditionTitle);
winConditionTitle.setY(winConditionTitle.getY() - 40);
attachChild(winConditionTitle);
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:19,代码来源:TextCutInTouchLayer.java
示例15: initTalk
import org.andengine.util.color.Color; //导入依赖的package包/类
public void initTalk(SparseArray<TiledSprite> faces, List<PlayerTalkDto> talks) {
// 初期化
this.talkIndex = 0;
this.textMaxLength = 0;
// 会話する顔を登録
this.faces = faces;
// 会話内容を登録
this.talks = talks;
// 設定された会話内容を元に最大テキストサイズで初期化してTextを用意する
textMaxLength = getMaxLength(talks);
talkText = new Text(16, 16, font,
getSizeToStr("-", textMaxLength),
new TextOptions(HorizontalAlign.LEFT),
baseScene.getBaseActivity().getVertexBufferObjectManager());
talkText.setAutoWrap(AutoWrap.WORDS);
nameText = new Text(16, 16, font,
getSizeToStr("-", textMaxLength),
new TextOptions(HorizontalAlign.LEFT),
baseScene.getBaseActivity().getVertexBufferObjectManager());
nameText.setColor(Color.GREEN);
nextTalk();
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:27,代码来源:TalkLayer.java
示例16: Bird
import org.andengine.util.color.Color; //导入依赖的package包/类
public Bird(float birdXOffset, float birdYOffset, VertexBufferObjectManager mVertexBufferObjectManager, Scene mScene) {
this.mBirdXOffset = birdXOffset;
this.mBirdYOffset = birdYOffset;
mSprite = new AnimatedSprite(mBirdXOffset, mBirdYOffset, 55.8f, 40, mBirdTextureRegion, mVertexBufferObjectManager);
mSprite.setColor(Color.YELLOW);
mSprite.animate(115);
mSprite.setZIndex(2);
mScene.attachChild(mSprite);
}
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:13,代码来源:Bird.java
示例17: loadGameFonts
import org.andengine.util.color.Color; //导入依赖的package包/类
public void loadGameFonts() {
mTypeface = Typeface.createFromAsset(mContext.getAssets(), "LCD.ttf");
final ITexture scoreTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 256, 512, TextureOptions.BILINEAR);
mGameFont = new Font(mContext.getFontManager(), scoreTexture, mTypeface, 18, true, new Color(Color.BLACK));
scoreTexture.load();
mGameFont.load();
final BitmapTextureAtlas gamePlayTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
mGamePlayFont = new StrokeFont(mContext.getFontManager(), gamePlayTexture, mTypeface, 96, true, new Color(Color.WHITE), 0, new Color(Color.WHITE));
gamePlayTexture.load();
mGamePlayFont.load();
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:15,代码来源:ResourceManager.java
示例18: loadMenuFonts
import org.andengine.util.color.Color; //导入依赖的package包/类
public void loadMenuFonts() {
FontFactory.setAssetBasePath("font/");
final ITexture menuTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
mMenuFont = FontFactory.createFromAsset(mContext.getFontManager(), menuTexture, mContext.getAssets(), "LCD.ttf", 18f, false, android.graphics.Color.BLACK);
menuTexture.load();
mMenuFont.load();
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:10,代码来源:ResourceManager.java
示例19: GameScene
import org.andengine.util.color.Color; //导入依赖的package包/类
public GameScene(final ResourceManager pResourceManager, final Camera pCamera, GameActivity pContext) {
super();
mContext = pContext;
mBackgroundSprite = new Sprite(0, 0, pResourceManager.mBackgroundRegion, mContext.getVertexBufferObjectManager());
mBackgroundSprite.setHeight(pCamera.getHeight() + 4);
mBackgroundSprite.setWidth(pCamera.getWidth());
mBackground = new VerticalParallaxBackground(193 / 255f, 208 / 255f, 170 / 255f) {
};
mBackground.attachVerticalParallaxEntity(new VerticalParallaxEntity(1.2f, mBackgroundSprite));
setBackground(mBackground);
mGameOverTextColor = new Color(253 / 255f, 255 / 255f, 225 / 255f);
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:15,代码来源:GameScene.java
示例20: ColorMenuItemDecorator
import org.andengine.util.color.Color; //导入依赖的package包/类
public ColorMenuItemDecorator(final IMenuItem pMenuItem, final Color pSelectedColor, final Color pUnselectedColor) {
super(pMenuItem);
this.mSelectedColor = pSelectedColor;
this.mUnselectedColor = pUnselectedColor;
pMenuItem.setColor(pUnselectedColor);
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:9,代码来源:ColorMenuItemDecorator.java
注:本文中的org.andengine.util.color.Color类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论