Examples of ImageLayer


Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

    button=new WelcomeButton(new Point(25,25),50);
    menu=new WorldMenu(new Point(getGameWidth()/2,getGameHeight()/2),game.getLocalPlayer().getMenuIndex());
   
    root.addComponentOnLayer(button);
    root.addComponentOnLayer(menu);
    root.addLayer(new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/blue_bg.png"), 720, 540));
  }
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

      root.addComponentOnLayer(buttons[i]);
    }
    root.addComponentOnLayer(table);
    root.addComponentOnLayer(progressLabel);
    root.addComponentOnLayer(totalLabel);
    root.addLayer(new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/leaderboard.png"),
        new Point(0,0), getGameWidth(), getGameHeight()));
   
    //connect to the server
    table.showText("Connecting...");
    reconnect();
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

  /**
   *
   */
  public EndingPage() {
    root=new GroupLayer();
    img=new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/ending.png"), getGameWidth(), getGameHeight());
    background=new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/blue_bg.png"),getGameWidth(),getGameHeight());
    button=new BackButton(new Point(55,getGameHeight()-55), 50);
  }
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

   *
   */
  public InformationPage() {
    this.roll=new InformationRoll(600,540);
    this.button=new WelcomeButton(new Point(25,25),50);
    this.background=new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/gray_bg.png"), getGameWidth(), getGameHeight());
    this.root=new GroupLayer();
  }
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

   
    for(GameButton button:buttons){
      root.addComponentOnLayer(button);
    }
     
    root.addLayer(new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/welcome_bg.png"), new Point(0,0), getGameWidth(), getGameHeight()));
    root.addComponentOnLayer(new GameLabel(new Point(getGameWidth()-5,3), TextAlign.RIGHT, TextBaseline.TOP, ASBOTXConfigs.VERSION, ASBOTXConfigs.Color.TEXT, ASBOTXConfigs.getCGFont(12)));
    root.addComponentOnLayer(creator.getWorld());
  }
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

    @Override
    public void doTask() {
     
      root.removeLayer(0);
      root.insertLayer(0,
          new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/hints/"+level.getWorldType()+"_hint_"+level.getLevelNumber()+".png"),
          new Point((getGameWidth()-HINT_WIDTH)/2,(getGameHeight()-HINT_HEIGHT)/2), HINT_WIDTH, HINT_HEIGHT));
      clickLabel.setText("click anywhere to continue");
      clickLabel.setY(30);
      button=null;
    }
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.mengine.layer.ImageLayer

  public FadingPage(ImageLayer img,Page nextPage){
    super(nextPage);
    this.layer=img;
  }
  public FadingPage(String sheetPath,int imgWidthInGame,int imgHeightInGame,Page nextPage) {
    this(new ImageLayer(MEngine.getAssetManager().getSpriteSheet(sheetPath),
      new Point((getGame().getGameInfo().getWidth()-imgWidthInGame)/2,
            (getGame().getGameInfo().getHeight()-imgHeightInGame)/2),
             imgWidthInGame,imgHeightInGame),nextPage);
       
  }
View Full Code Here

Examples of playn.core.ImageLayer

        for (int ii = 0; ii < IMG_COUNT; ii++) {
            CanvasImage image = graphics().createImage(width, IMG_HEIGHT);
            StringBuffer text = new StringBuffer();
            for (int tt = 0; tt < 25; tt++) text.append(ii+1);
            StyledText.span(text.toString(), TEXT).render(image.canvas(), 0, 0);
            ImageLayer layer = graphics().createImageLayer(image);
            _group.addAt(layer, 0, y);
            y += layer.scaledHeight();
        }

        return null;
    }
View Full Code Here

Examples of playn.core.ImageLayer

    @Override protected Group createIface () {
        // demo a repeating animation
        CanvasImage image = graphics().createImage(100, 100);
        image.canvas().setFillColor(0xFFFFCC99).fillCircle(50, 50, 50);
        ImageLayer circle = graphics().createImageLayer(image);

        float width = graphics().width();
        anim.addAt(layer, circle, 50, 100).then().
            repeat(circle).tweenX(circle).to(width-150).in(1000).easeInOut().then().
            tweenX(circle).to(50).in(1000).easeInOut();

        // demo the shake animation
        final ImageLayer click = StyledText.span("Click to Shake", STYLE).toLayer();
        click.addListener(new Pointer.Adapter() {
            @Override public void onPointerStart (Pointer.Event event) {
                if (_shaker != null) _shaker.complete();
                else _shaker = anim.shake(click).bounds(-3, 3, -3, 0).cycleTime(25, 25).in(1000).
                         then().action(_clear).handle();
            }
            protected final Runnable _clear = new Runnable() {
                public void run () { _shaker = null; }};
            protected Animation.Handle _shaker;
        });
        layer.addAt(click, (width-click.width())/2, 275);

        // demo animation groups
        CanvasImage ball = graphics().createImage(40, 40);
        ball.canvas().setFillColor(0xFF99CCFF).fillCircle(20, 20, 20);
        ImageLayer[] balls = new ImageLayer[6];
        for (int ii = 0; ii < balls.length; ii++) {
            layer.addAt(balls[ii] = graphics().createImageLayer(ball), 170+ii*50, 350);
        }
        anim.repeat(layer).add(dropBalls(balls, 0, 1)).then().
            add(dropBalls(balls, 1, 2)).then().
            add(dropBalls(balls, 3, 3));

        // test barrier delay
        CanvasImage sqimg = graphics().createImage(50, 50);
        sqimg.canvas().setFillColor(0xFF99CCFF).fillRect(0, 0, 50, 50);
        final ImageLayer square = graphics().createImageLayer(sqimg);
        square.setOrigin(25, 25);
        layer.addAt(square, 50, 300);
        square.addListener(new Pointer.Adapter() {
            @Override public void onPointerStart (Pointer.Event event) {
                square.setInteractive(false);
                _banim.tweenXY(square).to(50, 350);
                _banim.delay(250).then().tweenRotation(square).to(FloatMath.PI).in(500);
                _banim.addBarrier(1000);
                _banim.tweenXY(square).to(50, 300);
                _banim.delay(250).then().tweenRotation(square).to(0).in(500);
                _banim.addBarrier();
                _banim.action(new Runnable() {
                    public void run () { square.setInteractive(true); }
                });
            }
        });

        return null;
View Full Code Here

Examples of playn.core.ImageLayer

    protected Animation dropBalls (ImageLayer[] balls, int offset, int count) {
        float startY = 350;
        AnimGroup group = new AnimGroup();
        for (int ii = 0; ii < count; ii++) {
            ImageLayer ball = balls[ii+offset];
            group.tweenY(ball).to(startY+100).in(1000).easeIn().then().
                tweenY(ball).to(startY).in(1000).easeOut();
        }
        return group.toAnim();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.