Package com.pointcliki.core

Examples of com.pointcliki.core.TextEntity


  public Hyperlink(String text, String href, UnicodeFont font) {
    this(text, href, font, false);
  }
 
  public Hyperlink(String text, String href, UnicodeFont font, boolean selected) {
    fText = new TextEntity(text, TextEntity.ALIGN_LEFT, font);
    fText.position(new Vector2f(5, 2 + font.getHeight(text) / 2));
    addChild(fText, 0);
    resize(new Vector2f(fText.span().getWidth() + 10, fText.span().getHeight() + 4));
    fHref = href;
    if (selected) select();
View Full Code Here


    }, "delete logic");
    delete.resize(new Vector2f(155, 24));
    delete.position(new Vector2f(0, 26));
    addChild(delete, 3);
   
    TextEntity name = new TextEntity(l.name(), TextEntity.ALIGN_LEFT, EditorScene.LargeFont(), Color.darkGray);
    name.position(new Vector2f(0, 64));
    addChild(name, 4);
   
    int i = 80;
    int n = 100;
    // Add properties
    if (l.properties() == null) return;
    for (LogicProperty p: l.properties()) {
      if (p instanceof StringLogicProperty) {
        final StringLogicProperty s = (StringLogicProperty) p;
        // Add label
        TextEntity label = new TextEntity(s.name(), TextEntity.ALIGN_LEFT, GruntzGame.resourceManager().UIFont(), Color.darkGray);
        label.position(new Vector2f(2, i + 14));
        addChild(label, n);
        n--;
        i += 26;
       
        String[] choices = s.choices();
View Full Code Here

    };
    addChild(fBack);
   
    resize(new Vector2f(GruntzGame.instance().application().getWidth(), GruntzGame.instance().application().getHeight()));
   
    fText = new TextEntity("", TextEntity.ALIGN_CENTER, GruntzGame.resourceManager().largeFont(), COLOR);
    addChild(fText.position(new Vector2f(GruntzGame.instance().application().getWidth() / 2, GruntzGame.instance().application().getHeight() / 2)));
   
    fContinue = new HyperlinkText("Continue", TextEntity.ALIGN_CENTER, GruntzGame.resourceManager().largeFont(), Color.white, COLOR) {
      /**
       * Serial key
View Full Code Here

    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));
   
View Full Code Here

        fDownInfo = null;
       
        final ProgressBar downloadBar = new ProgressBar(new Vector2f(340, 32), new Color(20, 44, 48), HOVER);
        StartScene.this.addChild(downloadBar.position(new Vector2f(60, 115)));
       
        final TextEntity downloadText = new TextEntity("Please wait while Dizgruntled downloads\nrequired resources", TextEntity.ALIGN_LEFT, fFont);
        StartScene.this.addChild(downloadText.position(new Vector2f(60, 200)));
       
        // Download the resources
        final Thread downloader = new Thread() {
         
          private DownloadExtractor fVrzDown;
          private DownloadExtractor fRezDown;

          @Override
          public void run() {
            try {
              URL url = new URL("http://pointcliki.com/gruntz/download.txt");
              Scanner s = new Scanner(url.openStream());
              final String rez = s.nextLine();
              final String vrz = s.nextLine();
              s.close();
             
              // Download the VRZ
              fVrzDown = new DownloadExtractor(new URL(vrz), new File("lib/vrz.zip"), new File("lib/GRUNTZ.VRZ")) {
 
                @Override
                public void onError(Exception e) {
                  JFrame frame = new JFrame();
                  frame.setVisible(true);
                  frame.setLocationRelativeTo(null);
                  frame.setAlwaysOnTop(true);
                  JOptionPane.showMessageDialog(frame, "Sorry, Dizgruntled can't download the files at this time. Please try again later", "Download Error", 0);
                  frame.dispose();
                  fVrzDown.cancel();
                  fRezDown.cancel();
                 
                  // Clean up
                  removeChild(fBack);
                  downloadBar.cleanup();
                  downloadText.cleanup();
                  showDownloadPage();
                }
 
                @Override
                public void onExtracting() {
                  downloadText.text("Extracting resources...");
                }
 
                @Override
                public void onProgress(float f) {
                  downloadBar.percent(f / 2 + fRezDown.progress() / 2);
                }
 
                @Override
                public void onDone() {
                  done.set(done.get() + 1);
                }
             
              };
             
              // Download the REZ
              fRezDown = new DownloadExtractor(new URL(rez), new File("lib/rez.zip"), new File("lib/GRUNTZ.REZ")) {
 
                @Override
                public void onError(Exception e) {
                  JFrame frame = new JFrame();
                  frame.setVisible(true);
                  frame.setLocationRelativeTo(null);
                  frame.setAlwaysOnTop(true);
                  JOptionPane.showMessageDialog(frame, "Sorry, Dizgruntled can't download the files at this time. Please try again later", "Download Error", 0);
                  frame.dispose();
                  fVrzDown.cancel();
                  fRezDown.cancel();
                 
                  // Clean up
                  removeChild(fBack);
                  downloadBar.cleanup();
                  downloadText.cleanup();
                  showDownloadPage();
                }
 
                @Override
                public void onExtracting() {
                  downloadText.text("Extracting resources...");
                }
 
                @Override
                public void onProgress(float f) {
                  downloadBar.percent(f / 2 + fVrzDown.progress() / 2);
                }
 
                @Override
                public void onDone() {
                  done.set(done.get() + 1);                 
                }
             
              };
             
              final HyperlinkText cancelText = new HyperlinkText("Cancel Download", TextEntity.ALIGN_LEFT, fFont, Color.white, HOVER) {
                /**
                 * Serial key
                 */
                private static final long serialVersionUID = 896122497881495986L;
 
                @Override
                public void click() {
                  fVrzDown.cancel();
                  fRezDown.cancel();
                  // Clean up
                  removeChild(fBack);
                  downloadBar.cleanup();
                  downloadText.cleanup();
                  showDownloadPage();
                }
              };
              StartScene.this.addChild(cancelText.position(new Vector2f(60, 450)));
             
              fVrzDown.start();
              fRezDown.start();
             
            } catch (Exception e) {
              JFrame frame = new JFrame();
              frame.setVisible(true);
              frame.setLocationRelativeTo(null);
              frame.setAlwaysOnTop(true);
              JOptionPane.showMessageDialog(frame, "Sorry, Dizgruntled can't download the files at this time. Please try again later", "Download Error", 0);
              frame.dispose();
              // Clean up
              removeChild(fBack);
              downloadBar.cleanup();
              downloadText.cleanup();
              showDownloadPage();
            }
           
            fFinishedDownload = new Minion<FrameEvent>() {
              @Override
              public long run(Dispatcher<FrameEvent> dispatcher, String type, FrameEvent event) {
                if (done.get() < 2) {
                  return Minion.CONTINUE;
                } else {
                  // Clean up
                  removeChild(fBack);
                  downloadBar.cleanup();
                  downloadText.cleanup();
                  showMenuPage();
                 
                  return Minion.FINISH;
                }
              }
View Full Code Here

TOP

Related Classes of com.pointcliki.core.TextEntity

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.