Package com.google.gwt.maeglin89273.game.mengine.component

Examples of com.google.gwt.maeglin89273.game.mengine.component.GameLabel


  @Override
  public void onScreen() {
    final ASBOTXGame game=(ASBOTXGame)getGame();
    game.initLocalPlayer();
    layers=new GroupLayer();
    layers.addComponentOnLayer(new GameLabel(new Point(getGameWidth()/2,getGameHeight()/2),
        TextAlign.CENTER, TextBaseline.MIDDLE, "Loading...", ASBOTXConfigs.Color.WHITE,
        ASBOTXConfigs.getCGFont(26)));
    layers.addComponentOnLayer(new LoadingBar(35));
    layers.addComponentOnLayer(new Glass(getGameWidth(), getGameHeight()));
   
View Full Code Here


public class StepBoard extends GeneralComponent{
  private final GameLabel titleLabel;
  private final SpriteBlock block;
  public StepBoard(Point leftTopCorner,double centerX) {
    super(leftTopCorner, 200, 420);
    this.titleLabel=new GameLabel(new Point(centerX,30),
        TextAlign.CENTER,TextBaseline.MIDDLE,null, ASBOTXConfigs.Color.GRAY, ASBOTXConfigs.getCGFont(32));
    this.block=new SpriteBlock(0,0,200,420,MEngine.getAssetManager().getSpriteSheet("images/tutorial_steps.png"));
  }
View Full Code Here

   
    ScoreBoard(Point center) {
      super(center, 540,375);
     
      this.block=new SpriteBlock(0,0,720,500,MEngine.getAssetManager().getSpriteSheet("images/boards.png"));
      this.title=new GameLabel(new Point(getLeftX()+15,getTopY()+25), TextAlign.LEFT, TextBaseline.TOP,
          level.toString(), ASBOTXConfigs.Color.TRANSLUCENT_DARK_GRAY, ASBOTXConfigs.getCGFont(35));
      double buttonsY=getBottomY()-20;
      Point leftButtonPos=new Point(getX()-BUTTONS_SPACING,buttonsY);
      Point centerButtonPos=new Point(getX(),buttonsY);
      Point rightButtonPos=new Point(getX()+BUTTONS_SPACING,buttonsY);
     
     
      switch(status){
        case NEW_HIGH_SCORE:
         
          scoreLabels=new GameLabel[]{new GameLabel(new Point(getX(),getY()-40), TextAlign.CENTER, TextBaseline.MIDDLE,
              "New High Score!", ASBOTXConfigs.Color.LIGHT_BLUE,ASBOTXConfigs.Color.DARK_BLUE,0.5f, ASBOTXConfigs.getCGFont(45)),
              new GameLabel(new Point(getX(),getY()+50), TextAlign.CENTER, TextBaseline.MIDDLE,
                  Integer.toString(score),ASBOTXConfigs.Color.LIGHT_YELLOW, ASBOTXConfigs.Color.YELLOW_BORDER,2, ASBOTXConfigs.getCGFont(70))};
          buttons=new GameButton[]{new LevelMenuButton(leftButtonPos,BUTTONS_BOUNDS),
               new ReplayButton(centerButtonPos,BUTTONS_BOUNDS),
               new NextLevelButton(rightButtonPos,BUTTONS_BOUNDS)};
          break;
        case GENERAL:
          scoreLabels=new GameLabel[]{new GameLabel(new Point(getX(),getY()-30), TextAlign.CENTER, TextBaseline.MIDDLE,
              "High Score "+localPlayer.getScoreAt(level), ASBOTXConfigs.Color.LIGHT_BLUE,ASBOTXConfigs.Color.DARK_BLUE,0.5f, ASBOTXConfigs.getCGFont(45)),
                        new GameLabel(new Point(getX(),getY()+50), TextAlign.CENTER, TextBaseline.MIDDLE,
                  "Score "+score, ASBOTXConfigs.Color.GRAY,ASBOTXConfigs.Color.DARK_GRAY,1, ASBOTXConfigs.getCGFont(45))};
          buttons=new GameButton[]{new LevelMenuButton(leftButtonPos,BUTTONS_BOUNDS),
                       new ReplayButton(centerButtonPos,BUTTONS_BOUNDS),
                       new NextLevelButton(rightButtonPos,BUTTONS_BOUNDS)};
          break;
        case LEVEL_FAILED:
          scoreLabels=new GameLabel[]{new GameLabel(new Point(getX(),getY()+20), TextAlign.CENTER, TextBaseline.MIDDLE,
                        "Level Failed!", ASBOTXConfigs.Color.BLACK, ASBOTXConfigs.getCGFont(45))};
          buttons=new GameButton[]{new LevelMenuButton(leftButtonPos,BUTTONS_BOUNDS),
                new ReplayButton(rightButtonPos,BUTTONS_BOUNDS)};
                       
      }
View Full Code Here

     */
    public IDEnteredBoard(Point p) {
      super(p, 450, 150);
      block=new SpriteBlock(0,500+SpriteBlock.SPACING,720,240,MEngine.getAssetManager().getSpriteSheet("images/boards.png"));
      button=new SubmitButton(getPositionAt(PositionType.SOUTH));
      idLabel=new GameLabel(new Point(getX(),getY()), TextAlign.CENTER, TextBaseline.MIDDLE, "", ASBOTXConfigs.Color.BLACK, ASBOTXConfigs.getCGFont(28));
      messageLabel=new GameLabel(new Point(getX(),getBottomY()-40), TextAlign.CENTER, TextBaseline.MIDDLE, "", ASBOTXConfigs.Color.ORANGE, ASBOTXConfigs.getCGBoldFont(12));
    }
View Full Code Here

    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

    root.draw(context);
  }
  @Override
  public void onScreen() {
    Point center=new Point(getGameWidth()/2,getGameHeight()/2);
    clickLabel=new GameLabel(new Point(center.getX(),center.getY()+32), TextAlign.CENTER, TextBaseline.MIDDLE, "click here to continue", ASBOTXConfigs.Color.WHITE, clickTextFont);
    root=new GroupLayer();
    if(level.hasHint()){
      this.button=new HintButton(new Point(center.getX(),center.getY()+225));
      root.addComponentOnLayer(button);
    }
    root.addComponentOnLayer(new GameLabel(center, TextAlign.CENTER, TextBaseline.MIDDLE, "Pause", ASBOTXConfigs.Color.WHITE, pauseTextFont));
    root.addComponentOnLayer(clickLabel);
    root.addComponentOnLayer(new Glass(getGameWidth(),getGameHeight()));
    root.addLayer(new Layer(){

      @Override
View Full Code Here

  /* (non-Javadoc)
   * @see com.google.gwt.maeglin89273.game.mengine.page.Page#onScreen()
   */
  @Override
  public void onScreen() {
    layers.addComponentOnLayer(new GameLabel(new Point(getGameWidth()/2,60),TextAlign.CENTER,TextBaseline.MIDDLE,
                             world.getTitle(),ASBOTXConfigs.Color.GRAY,ASBOTXConfigs.getCGFont(32)));
   
    board=new ButtonBoard(400,getGameWidth()/2-200,110);
    back=new BackButton(new Point(30,30),25);
    layers.addComponentOnLayer(board);
View Full Code Here

   * @see com.google.gwt.maeglin89273.game.mengine.component.GeneralComponent#update()
   */
  @Override
  public void update() {
   
    Physical dc;
    for(int i=contentCreations.size()-1;i>=0;i--){
      dc=contentCreations.get(i);
      if(dc.isDestroyed()){
        contentCreations.remove(i);
      }else{
        dc.getBody().applyForce(forceVec, dc.getBody().getWorldCenter());
      }
    }
  }
View Full Code Here

  @Override
  public void update(){
    Vec2 shapePos;
    Vec2 pAToShape;
    Vec2 pBToShape;
    Physical dc;
    for(int i=creationsInField.size()-1;i>=0;i--){
      dc=creationsInField.get(i);
      if(dc.isDestroyed()){
        creationsInField.remove(i);
      }else{
        shapePos=dc.getBody().getWorldCenter();
        pAToShape=shapePos.sub(vecA);
        pBToShape=shapePos.sub(vecB);
        if(Vec2.dot(pAToShape, vecAToB)<0){
          if(pAToShape.lengthSquared()>ASBOTXConfigs.E_SQUARE){
            pAToShape.negateLocal();
            pAToShape.normalize();
            pAToShape.mulLocal(FORCE_MAGNITUDE);
            dc.getBody().applyForce(pAToShape,shapePos);
          }
        }else if(Vec2.dot(pBToShape, vecBToA)<0){
          if(pBToShape.lengthSquared()>ASBOTXConfigs.E_SQUARE){
            pBToShape.negateLocal();
            pBToShape.normalize();
            pBToShape.mulLocal(FORCE_MAGNITUDE);
            dc.getBody().applyForce(pBToShape,shapePos);
          }
        }else{
          dc.getBody().applyForce(Vec2.cross(pAToShape,vecAToB)>0?forces[0]:forces[1],shapePos);
        }
      }
    }
  }
View Full Code Here

      for(int i=0;i<transX.length;i++){
        transX[i]=(i-currentIndex+1)*SPACING;
      }
     
     
      sensorButton=new BoxButton(getPosition(), 220, 220, null){
       
        @Override
        public void doTask() {
          buttons[currentIndex].doTask();
         
View Full Code Here

TOP

Related Classes of com.google.gwt.maeglin89273.game.mengine.component.GameLabel

Copyright © 2018 www.massapicom. 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.