コード例 #1
0
ファイル: RouteOverlay.java プロジェクト: Ging-Buh/cachebox
 public Route(Color color, boolean isOpenRoute) {
   mIsOpenRoute = isOpenRoute;
   if (isOpenRoute) {
     ArrowSprite = new Sprite(Sprites.Arrows.get(5));
     PointSprite = new Sprite(Sprites.Arrows.get(10));
     ArrowSprite.scale(1.6f);
     PointSprite.scale(0.2f);
     overlap = 1.9f;
   } else {
     ArrowSprite = Sprites.Arrows.get(5);
     PointSprite = Sprites.Arrows.get(10);
     overlap = 0.9f;
   }
   mColor = color;
   Points = new ArrayList<TrackPoint>();
 }
コード例 #2
0
  public GameLoadingScreen(StrategyGame inGame) {

    this.game = inGame;
    this.font = game.font;
    this.batch = game.batch;

    stage = new Stage(new ScreenViewport());

    camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    Texture tex = new Texture(Gdx.files.internal("ui/game_loading.png"));
    background = new Sprite(tex);
    background.scale(1.0f);
    background.setPosition(
        (Gdx.graphics.getWidth() - background.getWidth()) / 2,
        (Gdx.graphics.getHeight() - background.getHeight()) / 2);
  }
コード例 #3
0
ファイル: Player.java プロジェクト: NickBeers/Happy-Potter
  private void init(MapLayer objectLayer) {
    try {
      sprite = new Sprite(Assets.instance.player.getNorthAnimation().getKeyFrame(0, false));
      sprite.scale(1.25f);
      sprite.setOrigin(0.0f, 0.0f);

      collisionLayer = (TiledMapTileLayer) Assets.instance.world.getMap().getLayers().get(0);

      for (MapObject obj : objectLayer.getObjects()) {
        if (obj instanceof EllipseMapObject) {
          Ellipse ellipse = ((EllipseMapObject) obj).getEllipse();
          position = UtilityMethods.mapToScreenCoordinate(new Vector2(ellipse.x, ellipse.y));
        }
      }
      sprite.setPosition(position.x, position.y);
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
  }