Package framework.component

Examples of framework.component.ParentComponent.addComponent()


    float x = gridX*spacing+10;
    float y = gridY*spacing+10;

    //TODO remove these weird coordinate adjustions.
    squareParent.addComponent(new PositionComponent(x,y));
    squareParent.addComponent(new SquareComponent(grid.getSquare(gridX, gridY)));

    return squareParent;
  }

View Full Code Here


    float x = gridX*spacing+10;
    float y = gridY*spacing+10;

    //TODO remove these weird coordinate adjustions.
    squareParent.addComponent(new PositionComponent(x,y));
    squareParent.addComponent(new SquareComponent(grid.getSquare(gridX, gridY)));

    return squareParent;
  }

  public static String getSquareLabel(Square square){
View Full Code Here

    }
  }

  private static void setUpScoreCounter(Player player) {
    ParentComponent counterParent = new ParentComponent();
    counterParent.addComponent(new ScoreCounterComponent(player));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(player.getId()), new Vector2f(-20, -12), 50, 50);
    counterParent.addComponent(spriteComp);
   
    counterParent.addComponent(new TextRenderComponent(""));
View Full Code Here

  private static void setUpScoreCounter(Player player) {
    ParentComponent counterParent = new ParentComponent();
    counterParent.addComponent(new ScoreCounterComponent(player));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(player.getId()), new Vector2f(-20, -12), 50, 50);
    counterParent.addComponent(spriteComp);
   
    counterParent.addComponent(new TextRenderComponent(""));
    counterParent.addComponent(new PositionComponent(690+(60*player.getId()), 25));
   
    ComponentSystem.getInstance().getParentComponentByLabel("Background").addComponent(counterParent);
View Full Code Here

    counterParent.addComponent(new ScoreCounterComponent(player));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(player.getId()), new Vector2f(-20, -12), 50, 50);
    counterParent.addComponent(spriteComp);
   
    counterParent.addComponent(new TextRenderComponent(""));
    counterParent.addComponent(new PositionComponent(690+(60*player.getId()), 25));
   
    ComponentSystem.getInstance().getParentComponentByLabel("Background").addComponent(counterParent);
  }
}
View Full Code Here

   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(player.getId()), new Vector2f(-20, -12), 50, 50);
    counterParent.addComponent(spriteComp);
   
    counterParent.addComponent(new TextRenderComponent(""));
    counterParent.addComponent(new PositionComponent(690+(60*player.getId()), 25));
   
    ComponentSystem.getInstance().getParentComponentByLabel("Background").addComponent(counterParent);
  }
}
View Full Code Here

import framework.spacial.PositionComponent;

public class TurnCounterGenerator {
  public static void setUpTurnCounter() {
    ParentComponent counterParent = new ParentComponent();
    counterParent.addComponent(new TurnCounterComponent());
    counterParent.addComponent(new TextRenderComponent("Current Move:"));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(0),new Vector2f(125, -8), 40, 40);
    //spriteComp.setAlwaysOnTop();
    counterParent.addComponent(spriteComp);
View Full Code Here

public class TurnCounterGenerator {
  public static void setUpTurnCounter() {
    ParentComponent counterParent = new ParentComponent();
    counterParent.addComponent(new TurnCounterComponent());
    counterParent.addComponent(new TextRenderComponent("Current Move:"));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(0),new Vector2f(125, -8), 40, 40);
    //spriteComp.setAlwaysOnTop();
    counterParent.addComponent(spriteComp);
    //300 500
View Full Code Here

    counterParent.addComponent(new TurnCounterComponent());
    counterParent.addComponent(new TextRenderComponent("Current Move:"));
   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(0),new Vector2f(125, -8), 40, 40);
    //spriteComp.setAlwaysOnTop();
    counterParent.addComponent(spriteComp);
    //300 500
    counterParent.addComponent(new PositionComponent(20, 28));
   
    ComponentSystem.getInstance().getParentComponentByLabel("Background").addComponent(counterParent);
  }
View Full Code Here

   
    SpriteComponent spriteComp = new SpriteComponent(ColourManager.getSquareForPlayer(0),new Vector2f(125, -8), 40, 40);
    //spriteComp.setAlwaysOnTop();
    counterParent.addComponent(spriteComp);
    //300 500
    counterParent.addComponent(new PositionComponent(20, 28));
   
    ComponentSystem.getInstance().getParentComponentByLabel("Background").addComponent(counterParent);
  }
}
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.