List of usage examples for com.badlogic.gdx.graphics Color Color
public Color(Color color)
From source file:com.company.minery.utils.spine.Skeleton.java
License:Open Source License
/** Copy constructor. */ public Skeleton(Skeleton skeleton) { if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); data = skeleton.data;// w w w . ja v a 2 s .co m bones = new Array(skeleton.bones.size); for (Bone bone : skeleton.bones) { Bone parent = bone.parent == null ? null : bones.get(skeleton.bones.indexOf(bone.parent, true)); bones.add(new Bone(bone, this, parent)); } slots = new Array(skeleton.slots.size); for (Slot slot : skeleton.slots) { Bone bone = bones.get(skeleton.bones.indexOf(slot.bone, true)); slots.add(new Slot(slot, bone)); } drawOrder = new Array(slots.size); for (Slot slot : skeleton.drawOrder) drawOrder.add(slots.get(skeleton.slots.indexOf(slot, true))); ikConstraints = new Array(skeleton.ikConstraints.size); for (IkConstraint ikConstraint : skeleton.ikConstraints) { Bone target = bones.get(skeleton.bones.indexOf(ikConstraint.target, true)); Array<Bone> ikBones = new Array(ikConstraint.bones.size); for (Bone bone : ikConstraint.bones) ikBones.add(bones.get(skeleton.bones.indexOf(bone, true))); ikConstraints.add(new IkConstraint(ikConstraint, ikBones, target)); } skin = skeleton.skin; color = new Color(skeleton.color); time = skeleton.time; flipX = skeleton.flipX; flipY = skeleton.flipY; updateCache(); }
From source file:com.company.minery.utils.spine.Slot.java
License:Open Source License
/** Copy constructor. */ public Slot(Slot slot, Bone bone) { if (slot == null) throw new IllegalArgumentException("slot cannot be null."); if (bone == null) throw new IllegalArgumentException("bone cannot be null."); data = slot.data;//from w w w .ja v a 2 s . c o m this.bone = bone; color = new Color(slot.color); attachment = slot.attachment; attachmentTime = slot.attachmentTime; }
From source file:com.cyphercove.lwptools.core.FullScreenFader.java
License:Apache License
public FullScreenFader(float delay, float fadeTime) { this(delay, fadeTime, new Color(Color.BLACK)); }
From source file:com.gamejolt.mikykr5.ceidecpong.states.MainMenuState.java
License:Open Source License
@Override public void onAssetsLoaded() { TextButtonStyle textButtonStyle;/*from ww w . j a v a 2 s . co m*/ // Create the button backgrounds. menuButtonEnabledTexture = loader.getAsset("data/gfx/gui/Anonymous_Pill_Button_Yellow.png", Texture.class); menuButtonDisabledTexture = loader.getAsset("data/gfx/gui/Anonymous_Pill_Button_Cyan.png", Texture.class); menuButtonPressedTexture = loader.getAsset("data/gfx/gui/Anonymous_Pill_Button_Blue.png", Texture.class); menuButtonEnabled9p = new NinePatch(new TextureRegion(menuButtonEnabledTexture, 0, 0, menuButtonEnabledTexture.getWidth(), menuButtonEnabledTexture.getHeight()), 49, 49, 45, 45); menuButtonDisabled9p = new NinePatch(new TextureRegion(menuButtonDisabledTexture, 0, 0, menuButtonDisabledTexture.getWidth(), menuButtonDisabledTexture.getHeight()), 49, 49, 45, 45); menuButtonPressed9p = new NinePatch(new TextureRegion(menuButtonPressedTexture, 0, 0, menuButtonPressedTexture.getWidth(), menuButtonPressedTexture.getHeight()), 49, 49, 45, 45); // Create the buttons. textButtonStyle = new TextButtonStyle(); textButtonStyle.font = buttonFont; textButtonStyle.up = new NinePatchDrawable(menuButtonEnabled9p); textButtonStyle.checked = new NinePatchDrawable(menuButtonPressed9p); textButtonStyle.disabled = new NinePatchDrawable(menuButtonDisabled9p); textButtonStyle.fontColor = new Color(Color.BLACK); textButtonStyle.downFontColor = new Color(Color.WHITE); textButtonStyle.disabledFontColor = new Color(Color.BLACK); startButton = new TextButton("Start game", textButtonStyle); startButton.setText("Start game"); startButtonBBox = new Rectangle(0, 0, startButton.getWidth(), startButton.getHeight()); quitButton = new TextButton("Quit", textButtonStyle); quitButton.setText("quit"); quitButtonBBox = new Rectangle(0, 0, quitButton.getWidth(), quitButton.getHeight()); // Set buttons. startButton.setPosition(-(startButton.getWidth() / 2), -(startButton.getHeight() / 2)); startButtonBBox.setPosition(startButton.getX(), startButton.getY()); quitButton.setPosition(-(quitButton.getWidth() / 2), (startButton.getY() - startButton.getHeight()) - 10); quitButtonBBox.setPosition(quitButton.getX(), quitButton.getY()); assetsLoaded = true; AsyncAssetLoader.freeInstance(); }
From source file:com.ixeption.libgdx.transitions.impl.ColorFadeTransition.java
License:Apache License
/** @param color the {@link Color} to fade to * @param interpolation the {@link Interpolation} method */ public ColorFadeTransition(Color color, Interpolation interpolation) { this.color = new Color(Color.WHITE); this.interpolation = interpolation; texture = new Texture(1, 1, Format.RGBA8888); Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(color);//from ww w. ja v a 2 s.com pixmap.fillRectangle(0, 0, 1, 1); texture.draw(pixmap, 0, 0); }
From source file:com.jmolina.orb.widgets.debug.DebugTime.java
License:Open Source License
public DebugTime(AssetManager am) { spriteBatch = new SpriteBatch(); Label.LabelStyle style = new Label.LabelStyle(); style.fontColor = new Color(Var.COLOR_RED); style.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_BOLD_45), am.getGameAtlas().findRegion(Atlas.FONT_ROBOTO_BOLD_45)); frametime = new Label("", style); frametime.setPosition(Utils.cell(1), Utils.cell(1)); }
From source file:com.jmolina.orb.widgets.game.Timer.java
License:Open Source License
/** * Constructor/* w ww. jav a 2 s .c o m*/ * * @param am AssetManager */ public Timer(AssetManager am) { super(am); Label.LabelStyle style = new Label.LabelStyle(); style.fontColor = new Color(Var.COLOR_WHITE); style.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_BOLD_90), findRegion(Atlas.FONT_ROBOTO_BOLD_90)); label = new Label("", style); label.setTouchable(Touchable.disabled); label.setPosition(0, 0); label.setHeight(Utils.cell(1.5f)); label.setWidth(Utils.cell(6)); label.setAlignment(Align.center); addActor(label); setTransform(false); setHeight(Utils.cell(1.5f)); reset(); }
From source file:com.jmolina.orb.widgets.ui.BigText.java
License:Open Source License
/** * Constructor//w w w. j a va 2 s. co m * * @param am AssetManager * @param text Texto */ public BigText(AssetManager am, String text) { super(am); Label.LabelStyle style = new Label.LabelStyle(); style.fontColor = new Color(Var.COLOR_GREEN_DARK); style.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_BOLD_90), findRegion(Atlas.FONT_ROBOTO_BOLD_90)); this.label = new Label(text, style); this.label.setTouchable(Touchable.disabled); this.label.setPosition(0f, 0f); this.label.setHeight(Utils.cell(1.5f)); this.label.setWidth(Utils.cell(10f)); this.label.setAlignment(Align.center); addActor(this.label); setHeight(Utils.cell(1.5f)); }
From source file:com.jmolina.orb.widgets.ui.Card.java
License:Open Source License
public Card(AssetManager am, GameManager gm, String title, String time, ScreenManager.Key level) { super(am);// w ww .j a v a2 s .c om gameManager = gm; fullFrame = new Image(getAsset(Asset.UI_CARD_FRAME, Texture.class)); coverFrame = new Image(getAsset(Asset.UI_CARD_COVER_FRAME, Texture.class)); cover = new Image(getCoverTexture(level)); coverBlur = new Image(getCoverBlurTexture(level)); background = new Image(getAsset(Asset.UI_CARD_BACKGROUND, Texture.class)); padlock = new Image(getAsset(Asset.UI_CARD_PADLOCK, Texture.class)); fullFrame.setPosition(0, 0); fullFrame.addAction(alpha(0)); fullFrame.act(0); coverFrame.setPosition(0, 0); background.setPosition(0f, 0f); cover.setPosition(0f, 0f); coverBlur.setPosition(0f, 0f); padlock.setPosition(Utils.cell(1.75f), Utils.cell(1)); Label.LabelStyle titleStyle = new Label.LabelStyle(); titleStyle.fontColor = new Color(Var.COLOR_GREEN_DARK); titleStyle.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_BOLD_45), findRegion(Atlas.FONT_ROBOTO_BOLD_45)); titleLabel = new Label(title, titleStyle); titleLabel.setTouchable(Touchable.disabled); titleLabel.setPosition(Utils.cell(5), Utils.cell(2.75f)); titleLabel.setHeight(Utils.cell(1)); titleLabel.setWidth(Utils.cell(4.5f)); titleLabel.setAlignment(Align.right); Label.LabelStyle timeStyle = new Label.LabelStyle(); timeStyle.fontColor = new Color(Var.COLOR_LILAC_DARK); timeStyle.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_REGULAR_30), findRegion(Atlas.FONT_ROBOTO_REGULAR_30)); timeLabel = new Label(time, timeStyle); timeLabel.setTouchable(Touchable.disabled); timeLabel.setPosition(Utils.cell(5), Utils.cell(0.25f)); timeLabel.setHeight(Utils.cell(0.75f)); timeLabel.setWidth(Utils.cell(4.5f)); timeLabel.setAlignment(Align.right); addActor(background); addActor(coverBlur); addActor(cover); addActor(coverFrame); addActor(fullFrame); addActor(padlock); addActor(titleLabel); addActor(timeLabel); setFrame(fullFrame); setHeight(Utils.cell(4)); lock(); }
From source file:com.jmolina.orb.widgets.ui.Credit.java
License:Open Source License
/** * Constructor/* w w w . j av a 2s . c om*/ * * @param am AssetManager * @param header Encabezado * @param body Texto descriptivo */ public Credit(AssetManager am, String header, String body) { super(am); links = new ArrayList<Label>(); Label.LabelStyle bodyStyle = new Label.LabelStyle(); bodyStyle.fontColor = new Color(Var.COLOR_LILAC_DARK); bodyStyle.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_REGULAR_30), findRegion(Atlas.FONT_ROBOTO_REGULAR_30)); Label.LabelStyle headerStyle = new Label.LabelStyle(); headerStyle.fontColor = new Color(Var.COLOR_GREEN_DARK); headerStyle.font = new BitmapFont(Gdx.files.internal(Font.FONT_ROBOTO_MEDIUM_45), findRegion(Atlas.FONT_ROBOTO_MEDIUM_45)); this.body = new Label(body, bodyStyle); this.body.setTouchable(Touchable.disabled); this.body.setPosition(0f, 0f); this.body.setWidth(Utils.cell(10)); this.body.setWrap(true); this.body.setAlignment(Align.topLeft); this.body.setHeight(this.body.getPrefHeight()); this.header = new Label(header, headerStyle); this.header.setTouchable(Touchable.disabled); this.header.setPosition(0f, this.body.getPrefHeight()); this.header.setSize(Utils.cell(10), Utils.cell(1)); this.header.setAlignment(Align.topLeft); addActor(this.header); addActor(this.body); setHeight(this.header.getPrefHeight() + this.body.getPrefHeight()); }