Package ru.snake.spritepacker.core

Examples of ru.snake.spritepacker.core.Sprite


  }

  @Override
  public void actionPerformed(ActionEvent arg0) {
    Animation animation = factory.getActiveAnimation();
    Sprite sprite = factory.getActiveSprite();

    if (animation == null || sprite == null) {
      Dialogs.warning(parent,
          Messages.getString("RemoveSpriteAction.NO_SPRITE")); //$NON-NLS-1$
View Full Code Here


      if (texture == null) {
        continue;
      }

      String name = Util.getFullName(each);
      Sprite sprite = new Sprite(0, 0, name, texture);

      spritelist.add(sprite);
    }

    String name = Util.getNameFromFiles(images);
View Full Code Here

      if (texture == null) {
        continue;
      }

      String name = Util.getFullName(each);
      Sprite sprite = new Sprite(point.x, point.y, name, texture);

      spritelist.add(sprite);
      offsetlist.add(point);
    }

    int commonX = 0;
    int commonY = 0;
    int width = 0;
    int height = 0;

    for (int index = 0; index < spritelist.size(); index++) {
      Point point = offsetlist.get(index);
      Sprite sprite = spritelist.get(index);

      commonX += point.x;
      commonY += point.y;

      if (width < sprite.getWidth()) {
        width = sprite.getWidth();
      }

      if (height < sprite.getHeight()) {
        height = sprite.getHeight();
      }
    }

    int destX = commonX / offsetlist.size() + width / 2;
    int destY = commonY / offsetlist.size() + height / 2;

    for (int index = 0; index < spritelist.size(); index++) {
      Point point = offsetlist.get(index);
      Sprite sprite = spritelist.get(index);

      sprite.offsetX = destX - point.x;
      sprite.offsetY = destY - point.y;
    }
View Full Code Here

        int offsetx = (Integer) offsxselected;
        int offsety = (Integer) offsyselected;
        Texture texture = (Texture) texselected;

        Sprite sptere = new Sprite(offsetx, offsety, spritename,
            texture);

        factory.addSprite(animation, sptere);

        break;
View Full Code Here

  }

  @Override
  public void actionPerformed(ActionEvent arg0) {
    Animation animation = factory.getActiveAnimation();
    Sprite sprite = factory.getActiveSprite();

    if (animation == null || sprite == null) {
      Dialogs.warning(parent,
          Messages.getString("OffsetSpriteAction.NO_SPRITE")); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of ru.snake.spritepacker.core.Sprite

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.