List of usage examples for com.badlogic.gdx.scenes.scene2d Actor setColor
public void setColor(float r, float g, float b, float a)
From source file:com.redthirddivision.astilade.render.tweens.ActorAccessor.java
License:Apache License
@Override public void setValues(Actor target, int type, float[] newValues) { switch (type) { case TweenTypes.ALPHA: target.setColor(target.getColor().r, target.getColor().g, target.getColor().g, newValues[0]); break;/*from w w w .j a va 2 s. co m*/ case TweenTypes.RGB: target.setColor(newValues[0], newValues[1], newValues[2], target.getColor().a); break; case TweenTypes.Y: target.setY(newValues[0]); break; case TweenTypes.SIZE: target.setScale(newValues[0], newValues[1]); break; default: assert false; } }
From source file:de.cwclan.gdxtest.core.tween.ActorAccessor.java
@Override public void setValues(Actor target, int tweenType, float[] newValues) { switch (tweenType) { case ALPHA:/*from ww w . j a va 2 s .co m*/ target.setColor(target.getColor().r, target.getColor().g, target.getColor().b, newValues[0]); break; case RGB: target.setColor(newValues[0], newValues[1], newValues[2], target.getColor().a); break; case Y: target.setY(newValues[0]); break; default: assert false; } }
From source file:de.myreality.acidsnake.tweens.LabelTween.java
License:Open Source License
@Override public void setValues(Actor target, int tweenType, float[] newValues) { switch (tweenType) { case ALPHA:/*from w w w . j av a 2s .c om*/ target.setColor(target.getColor().r, target.getColor().g, target.getColor().b, newValues[0]); break; case POPUP: target.setPosition(target.getX(), newValues[0]); break; } }
From source file:de.myreality.acidsnake.ui.PlayerActorAnimator.java
License:Open Source License
public PlayerActorAnimator(Actor actor, TweenManager manager) { this.tweenManager = manager; this.actor = actor; Tween.registerAccessor(Actor.class, new LabelTween()); actor.setColor(1f, 1f, 1f, 0.3f); }
From source file:es.eucm.ead.editor.view.builders.scene.groupeditor.GroupEditor.java
License:Open Source License
/** * Changes the current edited group to the given one. * /*from w w w .j av a 2 s .co m*/ * @param group * must be a direct child of the current edited group. If not, * nothing happens */ public void enterGroupEdition(Group group) { if (group != editedGroup && group != null && group.getChildren().size > 1 && editedGroup.getChildren().contains(group, true)) { editedGroup = group; for (Actor actor : editedGroup.getParent().getChildren()) { // Make non-edited actors transparent if (actor != editedGroup) { Color c = actor.getColor(); actor.setColor(c.r, c.g, c.b, c.a * ALPHA_FACTOR); } } for (Actor actor : editedGroup.getChildren()) { EngineUtils.computeTransformFor(actor, editedGroup.getParent()); } editedGroup.setPosition(0, 0); editedGroup.setRotation(0); editedGroup.setScale(1.0f, 1.0f); clearSelection(); fireSelection(); fireEnteredGroupEdition(editedGroup); } }
From source file:es.eucm.ead.editor.view.builders.scene.groupeditor.GroupEditor.java
License:Open Source License
/** * Edited group is set to the parent of the current edited group *//*from www.j a v a 2 s .c o m*/ public boolean endGroupEdition() { // Only can end a group edition of the edited group is not the root if (editedGroup != rootGroup) { clearSelection(); Group nextEditedGroup = editedGroup.getParent(); Group oldGroup = editedGroup; /* * The current edited group has changed. It is necessary to simplify * it in case it has less than 2 children, which will make it no * longer a group. */ Actor simplifiedGroup = simplifyGroup(oldGroup); /* * Removed the edited group. Whatever is left of it is in * simplifiedGroup. */ oldGroup.remove(); if (simplifiedGroup != null) { nextEditedGroup.addActor(simplifiedGroup); addToSelection(simplifiedGroup); fireTransformed(); } editedGroup = nextEditedGroup; // Restore transparency values for (Actor actor : editedGroup.getChildren()) { if (actor != editedGroup) { Color c = actor.getColor(); actor.setColor(c.r, c.g, c.b, c.a / ALPHA_FACTOR); } } fireSelection(); fireEndedGroupEdition(nextEditedGroup, oldGroup, simplifiedGroup); return true; } return false; }
From source file:es.eucm.ead.editor.view.widgets.draw.ColorPickerPanel.java
License:Open Source License
public void completeRowsIfPossible(WidgetGroup reference) { reference.layout();/*from www.j a va 2 s .c o m*/ IconButton image = (IconButton) colors.getChildren().first(); int rowsToAdd = Math.min( (int) Math.floor((Gdx.graphics.getHeight() - reference.getPrefHeight()) / image.getPrefHeight()), style.rows - colors.getRows()); for (int i = 0; i < rowsToAdd; i++) { addColorRow(); } SnapshotArray<Actor> children = colors.getChildren(); for (int i = 0, n = children.size; i < n; ++i) { Actor actor = children.get(i); int intCol = prefs.getInteger(Preferences.PREF_COLOR + i, -1); if (intCol == -1) { float[] rgb = picker.HSBtoRGB(i / (float) n, 1, 1); actor.setColor(rgb[0], rgb[1], rgb[2], 1f); } else { Color.rgba8888ToColor(actor.getColor(), intCol); actor.setColor(actor.getColor()); } } }
From source file:es.eucm.ead.editor.view.widgets.groupeditor.GroupEditorDragListener.java
License:Open Source License
/** * Changes the current edited group to the given one. * //from w ww.ja va 2 s . c o m * @param group * must be a direct child of the current edited group. If not, * nothing happens */ public void enterGroupEdition(Group group) { if (group != editedGroup && group != null && group != modifier && group.getChildren().size > 1 && editedGroup.getChildren().contains(group, true)) { editedGroup = group; for (Actor actor : editedGroup.getParent().getChildren()) { // Make non-edited actors transparent if (actor != editedGroup) { Color c = actor.getColor(); actor.setColor(c.r, c.g, c.b, c.a * ALPHA_FACTOR); } } modifier.deselectAll(true); fireEnteredGroupEdition(editedGroup); } }
From source file:es.eucm.ead.editor.view.widgets.groupeditor.GroupEditorDragListener.java
License:Open Source License
/** * Edited group is set to the parent of the current edited group *///from w w w .j a v a 2 s. c o m private void endGroupEdition() { // Only can end a group edition of the edited group is not the root if (editedGroup != rootGroup) { modifier.deselectAll(false); Group nextEditedGroup = editedGroup.getParent(); Group oldGroup = editedGroup; /* * The current edited group has changed. It is necessary to simplify * it in case it has less than 2 children, which will make it no * longer a group. */ Actor simplifiedGroup = simplifyGroup(oldGroup); /* * Removed the edited group. Whatever is left of it is in * simplifiedGroup. */ oldGroup.remove(); if (simplifiedGroup != null) { nextEditedGroup.addActor(simplifiedGroup); modifier.setSelection(simplifiedGroup); } editedGroup = nextEditedGroup; // Restore transparency values for (Actor actor : editedGroup.getChildren()) { if (actor != editedGroup) { Color c = actor.getColor(); actor.setColor(c.r, c.g, c.b, c.a / ALPHA_FACTOR); } } fireEndedGroupEdition(nextEditedGroup, oldGroup, simplifiedGroup); } }
From source file:pk.muneebahmad.app.tween.ImageAccessor.java
License:Open Source License
@Override public void setValues(Actor target, int tweenType, float[] newValues) { switch (tweenType) { case ALPHA:/*from www . j ava2 s . c o m*/ target.setColor(target.getColor().r, target.getColor().g, target.getColor().b, newValues[0]); break; default: break; } }