本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.actions.MoveToAction.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java MoveToAction.setPosition方法的具体用法?Java MoveToAction.setPosition怎么用?Java MoveToAction.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.actions.MoveToAction
的用法示例。
在下文中一共展示了MoveToAction.setPosition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: move3
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void move3(Group gr, float procent, float time) {
MoveToAction move = new MoveToAction();
move.setDuration(time);
if(time==0) {
move.setPosition(0, -procent * distanceReference);
}else {
if(Math.abs(procent)<=0.5) {
move.setPosition(0, 0);
}else if(procent>0.5){
move.setPosition(p2.x,p2.y);
}else{
move.setPosition(p4.x,p4.y);
}
}
gr.addAction(move);
}
示例2: show
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
@Override
public void show() {
title.setPosition(game.SCREEN_WIDTH / 2 - title.getWidth() / 2, 800);
//helpTip.setPosition(400-helpTip.getWidth()/2, 30);
MoveToAction actionMove = Actions.action(MoveToAction.class);
actionMove.setPosition(game.SCREEN_WIDTH / 2 - title.getWidth() / 2, 380);
actionMove.setDuration(1);
actionMove.setInterpolation(Interpolation.elasticOut);
title.addAction(actionMove);
if (!music.isPlaying()) {
music = Assets.getManager().get("snd/menu_music.mp3", Music.class);
music.play();
}
showMenu(true);
}
示例3: showMenu
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void showMenu(boolean flag) {
MoveToAction actionMove1 = Actions.action(MoveToAction.class);//out
actionMove1.setPosition(game.SCREEN_WIDTH / 2, -200);
actionMove1.setDuration(1);
actionMove1.setInterpolation(Interpolation.swingIn);
MoveToAction actionMove2 = Actions.action(MoveToAction.class);//in
actionMove2.setPosition(game.SCREEN_WIDTH / 2, 190);
actionMove2.setDuration(1f);
actionMove2.setInterpolation(Interpolation.swing);
if (flag) {
table.addAction(actionMove2);
options.addAction(actionMove1);
} else {
options.addAction(actionMove2);
table.addAction(actionMove1);
}
menuShown = flag;
exitShown = false;
}
示例4: showExit
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void showExit(boolean flag) {
MoveToAction actionMove1 = Actions.action(MoveToAction.class);//out
actionMove1.setPosition(game.SCREEN_WIDTH / 2, -200);
actionMove1.setDuration(1);
actionMove1.setInterpolation(Interpolation.swingIn);
MoveToAction actionMove2 = Actions.action(MoveToAction.class);//in
actionMove2.setPosition(game.SCREEN_WIDTH / 2, 190);
actionMove2.setDuration(1f);
actionMove2.setInterpolation(Interpolation.swing);
if (flag) {
exit.addAction(actionMove2);
table.addAction(actionMove1);
} else {
table.addAction(actionMove2);
exit.addAction(actionMove1);
}
exitShown = flag;
}
示例5: play
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void play() {
AlphaAction alphaAction = new AlphaAction();
alphaAction.setAlpha(0);
alphaAction.setDuration(0.5f);
play.addAction(alphaAction);
play.setTouchable(Touchable.disabled);
MoveToAction moveToAction = new MoveToAction();
moveToAction.setPosition(gameTitle.getX(), HEIGHT * 12 / 13 - gameTitle.getHeight());
moveToAction.setDuration(2);
gameTitle.addAction(moveToAction);
Timer.instance().clear();
gameTitle.setText("L'Odyssée des Maths");
currentState = State.TRANSITION;
}
示例6: addfirst
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void addfirst() {
if(arrayDefenders.length>7) {
arrayDefenders[arrayDefenders.length - 1].setVisible(true);
arrayDefenders[arrayDefenders.length - 1].toBack();
MoveToAction move = new MoveToAction();
move.setDuration(0);
move.setPosition(p0.x, p0.y);
arrayDefenders[arrayDefenders.length - 1].addAction(move);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(0);
scale.setScale(0.5f);
arrayDefenders[arrayDefenders.length - 1].addAction(scale);
}
}
示例7: translateup
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void translateup(Group[] arrayGroup) {
ScaleToAction scaleToAction = new ScaleToAction();
scaleToAction.setScale(1, 1);
scaleToAction.setDuration(0.4f);
MoveToAction moveToAction = new MoveToAction();
moveToAction.setPosition(0, 0);
moveToAction.setDuration(0.4f);
arrayGroup[1].toFront();
arrayGroup[1].addAction(moveToAction);
arrayGroup[1].addAction(scaleToAction);
ScaleToAction scaleToAction1 = new ScaleToAction();
scaleToAction1.setScale(0.8f, 0.8f);
scaleToAction1.setDuration(0.4f);
MoveToAction moveToAction1 = new MoveToAction();
moveToAction1.setPosition(Gdx.graphics.getWidth() * 0.1f, Gdx.graphics.getHeight() * 0.28f);
moveToAction1.setDuration(0.4f);
arrayGroup[0].addAction(scaleToAction1);
arrayGroup[0].addAction(moveToAction1);
MoveToAction moveToAction2 = new MoveToAction();
moveToAction2.setPosition(Gdx.graphics.getWidth() * 0.1f, -Gdx.graphics.getHeight() * 0.1f);
moveToAction2.setDuration(0.4f);
arrayGroup[2].addAction(moveToAction2);
MoveToAction moveToAction3 = new MoveToAction();
moveToAction3.setPosition(Gdx.graphics.getWidth() * 0.1f, 0);
moveToAction3.setDuration(0.4f);
arrayGroup[3].addAction(moveToAction3);
}
示例8: move1
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void move1(Group gr, float procent, float time) {
MoveToAction move = new MoveToAction();
move.setDuration(time);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(time);
if(time == 0) {
gr.clearActions();
gr.clearActions();
if (procent > 0) {
scale.setScale(0.8f - (Math.abs(procent) * 0.3f));
move.setPosition(p1.x + (procent * d01.x), p1.y + (1 - (procent * d01.y)));
} else {
scale.setScale(0.8f + (Math.abs(procent) * 0.2f));
move.setPosition(p1.x + (procent * d12.x), p1.y + (1 - (procent * d12.y)));
}
}else{
if(Math.abs(procent)<=0.5){
scale.setScale(0.8f);
move.setPosition(p1.x,p1.y);
}else if(procent > 0.5){
scale.setScale(0.5f);
move.setPosition(p0.x, p0.y);
}else{
scale.setScale(1);
move.setPosition(p2.x,p2.y);
}
}
gr.addAction(scale);
gr.addAction(move);
}
示例9: addfirst
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void addfirst() {
if(arrayAttachers.length>7) {
arrayAttachers[arrayAttachers.length - 1].setVisible(true);
arrayAttachers[arrayAttachers.length - 1].toBack();
MoveToAction move = new MoveToAction();
move.setDuration(0);
move.setPosition(p0.x, p0.y);
arrayAttachers[arrayAttachers.length - 1].addAction(move);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(0);
scale.setScale(0.5f);
arrayAttachers[arrayAttachers.length - 1].addAction(scale);
}
}
示例10: FadeIn
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
public void FadeIn(){
gr.clearActions();
MoveToAction in = new MoveToAction();
in.setPosition(0.0f, 0.0f);
in.setDuration(2f);
gr.addAction(in);
}
示例11: ScreenLoading
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
public ScreenLoading(GameManager game) {
gameManager = game;
assets = ManagerAssets.getInstance();
MoveToAction mred = new MoveToAction();
mred.setPosition(Width , -Height);
mred.setDuration(2f);
MoveToAction mred1 = new MoveToAction();
mred1.setPosition(-Width , Height);
mred1.setDuration(0);
translatered = new RepeatAction();
translatered.setCount(RepeatAction.FOREVER);
translatered.setAction(new SequenceAction(new DelayAction(0.0f), mred,mred1, new DelayAction(4.0f)));
MoveToAction mgreen = new MoveToAction();
mgreen.setPosition(Width , -Height );
mgreen.setDuration(2f);
MoveToAction mgreen1 = new MoveToAction();
mgreen1.setPosition(-Width , Height);
mgreen1.setDuration(0);
translategreen = new RepeatAction();
translategreen.setCount(RepeatAction.FOREVER);
translategreen.setAction(new SequenceAction(new DelayAction(2.0f), mgreen,mgreen1, new DelayAction(4.0f)));
MoveToAction mblue = new MoveToAction();
mblue.setPosition(Width , -Height);
mblue.setDuration(2f);
MoveToAction mblue1 = new MoveToAction();
mblue1.setPosition(-Width , Height);
mblue1.setDuration(0);
translateblue = new RepeatAction();
translateblue.setCount(RepeatAction.FOREVER);
translateblue.setAction(new SequenceAction(new DelayAction(4.0f), mblue,mblue1,new DelayAction(4.0f)));
}
示例12: addlast
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void addlast() {
if(arrayDefenders.length>7) {
arrayDefenders[7].setVisible(true);
arrayDefenders[7].toBack();
MoveToAction move = new MoveToAction();
move.setDuration(0);
move.setPosition(p6.x, p6.y);
arrayDefenders[7].addAction(move);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(0);
scale.setScale(0.5f);
arrayDefenders[7].addAction(scale);
}
}
示例13: move0
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void move0(Group gr, float procent, float time) {
MoveToAction move = new MoveToAction();
move.setDuration(time);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(time);
if(time == 0) {
gr.clearActions();
gr.clearActions();
if (procent < 0) {
scale.setScale(0.5f + (Math.abs(procent) * 0.3f));
move.setPosition(p0.x + procent * d01.x, p0.y + (1 - (procent * d01.y)));
addfirst();
}else{
scale.setScale(0.5f);
move.setPosition(p0.x,p0.y);
}
}else{
if(Math.abs(procent)<=0.5){
scale.setScale(0.5f);
move.setPosition(p0.x,p0.y);
}else if(procent < -0.5) {
scale.setScale(0.8f);
move.setPosition(p1.x, p1.y);
addfirst();
}else{
scale.setScale(0.5f);
move.setPosition(p0.x,p0.y);
}
}
gr.addAction(scale);
gr.addAction(move);
}
示例14: move2
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void move2(Group gr, float procent, float time) {
MoveToAction move = new MoveToAction();
move.setDuration(time);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(time);
if(time == 0) {
if (procent > 0) {
scale.setScale(1 - (Math.abs(procent) * 0.2f));
move.setPosition(p2.x + procent * d12.x, p2.y + (1 - (procent * d12.y)));
} else {
scale.setScale(1);
move.setPosition(0, p2.y - procent * distanceReference);
}
}else{
if(Math.abs(procent)<=0.5){
scale.setScale(1);
move.setPosition(p2.x,p2.y);
}else if(procent>0.5){
scale.setScale(0.8f);
move.setPosition(p1.x,p1.y);
}else{
scale.setScale(1);
move.setPosition(0,0);
}
}
gr.addAction(scale);
gr.addAction(move);
}
示例15: move5
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; //导入方法依赖的package包/类
private void move5(Group gr, float procent, float time) {
MoveToAction move = new MoveToAction();
move.setDuration(time);
ScaleToAction scale = new ScaleToAction();
scale.setDuration(time);
if(time == 0) {
gr.clearActions();
gr.clearActions();
if (procent > 0) {
scale.setScale(0.8f + (Math.abs(procent) * 0.2f));
move.setPosition(p5.x - (procent * d45.x), p5.y + (1 - (procent * d45.y)));
} else {
scale.setScale(0.8f - (Math.abs(procent) * 0.3f));
move.setPosition(p5.x - (procent * d56.x),p5.y + (1-(procent*d56.y)));
}
}else{
if(Math.abs(procent)<=0.5){
scale.setScale(0.8f);
move.setPosition(p5.x,p5.y);
}else if(procent > 0.5){
scale.setScale(1);
move.setPosition(p4.x, p4.y);
}else{
scale.setScale(0.5f);
move.setPosition(p6.x,p6.y);
}
}
gr.addAction(scale);
gr.addAction(move);
}