Package com.pointcliki.core

Examples of com.pointcliki.core.Sprite


      protected AnimatedSprite fSprite;
      protected String fName;

      public LogicSprite(String name, AnimatedSprite sp) {
        fSprite = sp;
        Sprite s = new Sprite(fSprite.image(0));
        fSpan = s.span();
        fName = name;
        addChild(s);
      }
View Full Code Here


  private static final long serialVersionUID = 6184459282941811191L;
 
  public SaveButton() {
    super();
   
    Sprite s = new Sprite("editor/save");
    addChild(s);
    fSpan = s.span();
  }
View Full Code Here

   
    fGroups = groups.toArray(new String[groups.size()]);
    fTotalTriggers = fGroups.length;

    // Determine the mode   
    Sprite sprite = new Sprite(GruntzGame.resourceManager().spritesheet("editor/logics", 17, 17));
         
    if (logic.equals("TileSecretTrigger")) {
      sprite.subimage(0, 2);
      fMode = 3;
     
      // Get the secret tile and layer
      fWWDTile = MonolithWWD.readSmarts(data);
     
    } else if (logic.equals("SecretLevelTrigger")) {
      sprite.subimage(2, 2);
      fMode = 4;
     
    } else if (fGroups.length == 0) {
      fMode = 2;
      sprite.subimage(1, 2);
     
    } else if (fDelay > 0 || fFlip > 0) {
      fMode = 1;
      sprite.subimage(1, 0);
     
    } else {
      sprite.subimage(0, 1);
   
    }
    addChild(sprite);
  }
View Full Code Here

    fFlip = object.optInt("flip", 0);
    fFlop = object.optInt("flop", 0);
    fLayer = object.optInt("layer", 0);
    fNewTile = object.optString("tile", "DEF");
   
    Sprite sprite = new Sprite(GruntzGame.resourceManager().spritesheet("editor/logics", 17, 17));
    if (fMode == 0) sprite.subimage(0, 1);
    else if (fMode == 1) sprite.subimage(1, 0);
    else if (fMode == 2) sprite.subimage(1, 2);
    else if (fMode == 3) sprite.subimage(0, 2);
    else sprite.subimage(2, 2);
    addChild(sprite);
  }
View Full Code Here

  private Sprite fClayAmount;
  private long fClayHide;
  private int fAmount;
 
  public ClayBar() {
    fBack = new Sprite("hud/clay");
    addChild(fBack);
   
    fClayAmount = new Sprite("hud/clay_amount") {
      /**
       * Serial key
       */
      private static final long serialVersionUID = 5134044335383021329L;

View Full Code Here

  private static final Color COLOR = new Color(249, 216, 31);
 
  public HudOverlay(HUD hud) {
    fHUD = hud;
   
    fBack = new Sprite() {
      /**
       * Serial key
       */
      private static final long serialVersionUID = 23573724L;
     
View Full Code Here

    fPalette = new GruntPalette(fColor, GruntzGame.resourceManager().rez().file("GRUNTZ/PALETTEZ/" + fColor + "TOOL", "pal"));
    animate("IDLE1", "IDLE");
    fCursor = new MonolithANI(GruntzGame.resourceManager().rez().file("GAME/ANIZ/GRUNTSELECTEDSPRITE", "ani"), "GAME/IMAGEZ/GRUNTSELECTEDSPRITE").sprite();
   
    // Health
    fHealthSprite = new Sprite(new MonolithPID(GruntzGame.resourceManager().rez().file("GAME/IMAGEZ/GRUNTHEALTHSPRITE/FRAME001", "pid")).image());
    fHealthSprite.position(new Vector2f(-12, -26));
   
    fStaminaSprite = new Sprite(new MonolithPID(GruntzGame.resourceManager().rez().file("GAME/IMAGEZ/GRUNTSTAMINASPRITE/FRAME001", "pid")).image());
    fStaminaSprite.position(new Vector2f(-12, -32));
   
    // Setup the grunt movement
    fMovement = new GridAlignedMovementOld<Grunt>(this, new MovementMinion(), 0, 0) {
View Full Code Here

    initFonts();
       
    fSW = fGame.application().getWidth();
    fSH = fGame.application().getHeight();
   
    fTopBar = new Sprite("editor/topbar");
    fTopBar.resize(new Vector2f(fSW, 28));
   
    fTitle = new TextEntity("Dizgruntled Level Editor", TextEntity.ALIGN_LEFT, sFont, new Color(255, 220, 50));
    fTitle.position(new Vector2f(5, 13));
   
    fSave = new SaveButton();
    fSave.position(new Vector2f(192, 8));
   
    fLinks = new EntityQuery<Hyperlink>();
    addChild(fLinks.add(new Hyperlink("Level", "level", sFont, true)).position(new Vector2f(210, 4)), 104);
    addChild(fLinks.add(new Hyperlink("Tiles", "tiles", sFont)).position(new Vector2f(255, 4)), 105);
    addChild(fLinks.add(new Hyperlink("Smarts", "smarts", sFont)).position(new Vector2f(297, 4)), 106);
    addChild(fLinks.add(new Hyperlink("Logics", "logics", sFont)).position(new Vector2f(358, 4)), 107);
   
    Minion<IEvent> clicker = new Minion<IEvent>() {
      @Override
      public long run(Dispatcher<IEvent> dispatcher, String type, IEvent event) {
        if (!(event instanceof HyperlinkEvent)) return Minion.CONTINUE;
        HyperlinkEvent ev = (HyperlinkEvent) event;
        for (Hyperlink h: fLinks) if (!h.equals(ev.hyperlink())) h.deselect();
       
        boolean showLogics = false;
        boolean showCursor = false;
       
        if (fAniCursor != null) {
          fAniCursor.cleanup();
          fAniCursor = null;
        }
       
        // Create correct side bar
        if (ev.href().equals("level")) {
          LevelSideBar s = new LevelSideBar();
          setSideContainer(s);
          s.init();
          showLogics = true;
        } else if (ev.href().equals("tiles")) {
          TilesSideBar s = new TilesSideBar();
          setSideContainer(s);
          s.init();
          showCursor = true;
        } else if (ev.href().equals("smarts")) {
          SmartsSideBar s = new SmartsSideBar();
          setSideContainer(s);
          s.init();
          showCursor = true;
        } else if (ev.href().equals("logics")) {
          ObjectSideBar s = new ObjectSideBar();
          setSideContainer(s);
          s.init();
          if (fSelectedLogic != null) s.editLogic(fSelectedLogic);
          showLogics = true;
        }
        if (showLogics) fMapViewer.showLogics();
        else fMapViewer.hideLogics();
        if (showCursor) addChild(fCursor, 20);
        else removeChild(fCursor);
               
        return Minion.CONTINUE;
      }
    };
    for (Hyperlink h: fLinks) h.dispatcher().addMinion("hyperlink", clicker);
   
    fSideBar = new Sprite("editor/sidebar");
    fSideBar.position(new Vector2f(fSW - 164, 28));
    fSideBar.resize(new Vector2f(164, fSH - 28));
   
    addChild(fTopBar, 100);
    addChild(fTitle, 101);
    addChild(fSave, 102);
    addChild(fSideBar, 103);
   
    fMapManager.importLevel(GruntzGame.resourceManager().rez().file("AREA1/WORLDZ/LEVEL1", "wwd"));
   
    // Scroll bars
    fScrollX = new ScrollBar(new Minion<SelectionEvent>(){
      @Override
      public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
        fMapViewer.offset(new Vector2f(16 - event.value(), fMapViewer.offset().y));
        return Minion.CONTINUE;
      }
    }, false);
    fScrollX.resize(new Vector2f(fSW - 176, 12));
    fScrollX.position(new Vector2f(0, fSH - 12));
   
    fScrollX.barSpan(fSW - 176);
    addChild(fScrollX, 104);
    fScrollY = new ScrollBar(new Minion<SelectionEvent>() {
      @Override
      public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
        fMapViewer.offset(new Vector2f(fMapViewer.offset().x, 16 - event.value()));
        return Minion.CONTINUE;
      }
    }, true);
    fScrollY.resize(new Vector2f(12, fSH - 40));
    fScrollY.position(new Vector2f(fSW - 176, 28));
    fScrollY.barSpan(fSH - 44);
    addChild(fScrollY, 105);
   
    try {
      fCursor = new Sprite(new Image(0, 0)) {
        /**
         * Serial Key
         */
        private static final long serialVersionUID = 1L;

View Full Code Here

 
  @Override
  public void importFromWWD(String logic, String image, String animation, byte[] data) {
    super.importFromWWD(logic, image, animation, data);
   
    Sprite sprite = new Sprite(GruntzGame.resourceManager().spritesheet("editor/logics", 17, 17));
    if (logic.equals("Brickz"))
      sprite.subimage(2, 0);
    else {
      sprite.subimage(2, 1);
     
      fType = Pickup.typeForIndex(MonolithWWD.readPowerup(data));
      fItem = Pickup.itemForIndex(MonolithWWD.readPowerup(data));
      fWWDTile = MonolithWWD.readSmarts(data);
    }
View Full Code Here

    fType = object.optString("type");
    fItem = object.optString("item");
    fLayer = object.optInt("layer", 0);
    fNewTile = object.optString("tile", "DEF");
   
    Sprite sprite = new Sprite(GruntzGame.resourceManager().spritesheet("editor/logics", 17, 17));
    sprite.subimage(2, 1);
    addChild(sprite);
  }
View Full Code Here

TOP

Related Classes of com.pointcliki.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.