旋转效果添加图像组(libgdx)

时间:2014-06-28 02:50:42

标签: java android libgdx

 public void FillTableValueGrid(int[] Arr)
     {

        grp = new Group();
        grp.setHeight(AssetsHelper.convertHeight(4*187));
        grp.setWidth(AssetsHelper.convertWidth(124));
        grp.setPosition(680, AssetsHelper.convertHeight(180));
            for(int i=0;i<Arr.length;i++)
            {
                ActualPieceArray[i]=ImagesPieceArray2[set1Array[i]];
                ImagesAnswerArray[Arr[i]].setVisible(false);
                ActualIntArray[i]=Arr[i];
            }
            ActualPieceArray[0].setPosition(AssetsHelper.convertWidth(0), AssetsHelper.convertHeight(100));
                grp.addActor(ActualPieceArray[0]);

                for(int i=1;i<9;i++)
                {

                    ActualPieceArray[i].setPosition(AssetsHelper.convertWidth(0), ActualPieceArray[i-1].getY()- ActualPieceArray[i-1].getHeight());
                    grp.addActor(ActualPieceArray[i]);
                    //System.out.println("trace herer  :::"+ grp.getY());
                }


                stage.addActor(grp);
                Mask=new Image(AssetsHelper.Mask);
                Mask.setPosition(AssetsHelper.convertWidth(656/2),AssetsHelper.convertHeight((552)/2));
                Mask1=new Image(AssetsHelper.Mask1);
                Mask1.setPosition(AssetsHelper.convertWidth(656/2),0);
                stage.addActor(Mask);
                stage.addActor(Mask1);
                ArrowUper = new Image(AssetsHelper.ArrowUp);
                ArrowUper.setPosition(AssetsHelper.convertWidth(368),AssetsHelper.convertHeight(280));
                stage.addActor(ArrowUper);
                //ImageCliked(ArrowUper);
                ArrowDowner = new Image(AssetsHelper.ArrowDown);
                ArrowDowner.setPosition(AssetsHelper.convertWidth(368),AssetsHelper.convertHeight(14));
                stage.addActor(ArrowDowner);
                ImageCliked1(ArrowDowner);

                    ImageCliked(ArrowUper);


     }


 public void ImageCliked(Actor actor)
     {
         actor.addListener(new InputListener() {
                public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
                    grp.addAction(Actions.sequence(
                        Actions.fadeOut(0),
                        Actions.parallel(
                        Actions.fadeIn(1.0f),
                        Actions.moveTo(grp.getX(), grp.getY()+AssetsHelper.convertHeight(100/2)))));
                        Counter--;
                        EnableAndDisable(Counter);

                      System.out.println("Please ImageClikedS Counter  grp.getY()    :::"+Counter+ grp.getY());

                     return true;
                }

                public void touchUp (InputEvent event, float x, float y, int pointer, int button) {


            //  return false;
            }
        });


     }

添加了一个简短的代码,其中FillTableValueGrid用于添加图像和用于向上/向下移动的图像。我是java libgdx的新手;当我在最后一张图像后点击按钮时,我想要该组的旋转效果;首先图像应该来了。任何人都可以帮忙解决。

0 个答案:

没有答案