Examples of ParticleSystem


Examples of org.newdawn.slick.particles.ParticleSystem

    if (resp == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      File path = file.getParentFile();
     
      try {
        ParticleSystem system = ParticleIO.loadConfiguredSystem(file);
        game.setSystem(system);
        emitters.clear();
       
        for (int i=0;i<system.getEmitterCount();i++) {
          final ConfigurableEmitter emitter = (ConfigurableEmitter) system.getEmitter(i);
         
          if (emitter.getImageName() != null) {
            File possible = new File(path, emitter.getImageName());
            if (possible.exists()) {
              emitter.setImageName(possible.getAbsolutePath());
            } else {
              chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
              FileFilter filter = new FileFilter() {
                public boolean accept(File f) {
                  if (f.isDirectory()) {
                    return true;
                  }
                 
                  return (f.getName().equals(emitter.getImageName()));
                }
 
                public String getDescription() {
                  return emitter.getImageName();
                }
              };
             
              chooser.addChoosableFileFilter(filter);
              resp = chooser.showOpenDialog(this);
              if (resp == JFileChooser.APPROVE_OPTION) {
                File image = chooser.getSelectedFile();
                emitter.setImageName(image.getAbsolutePath());
                path = image.getParentFile();
              }
              chooser.setDialogTitle("Open");
              chooser.resetChoosableFileFilters();
              chooser.addChoosableFileFilter(xmlFileFilter);
            }
          }
         
          emitters.add(emitter);
        }
        additive.setSelected(system.getBlendingMode() == ParticleSystem.BLEND_ADDITIVE);
        pointsEnabled.setSelected(system.usePoints());
       
        emitters.setSelected(0);
      } catch (IOException e) {
        Log.error(e);
        JOptionPane.showMessageDialog(this, e.getMessage());
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  }
 
  private void createSystem() {
    if(this.system == null) {
      try {
        this.system = new ParticleSystem(ResourceManager.getInstance().getImage("particle.png"), 200);
        this.system.addEmitter(this.factory.createParticleEmitter());
        this.factory = null;
      } catch(ResourceError e) {
        Log.error(e);
      }
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  }

  private void createSystem() {
    if (this.system == null) {
      try {
        this.system = new ParticleSystem(ResourceManager.getInstance()
            .getImage("textures/particle.png"), 200);
        this.system.addEmitter(this.factory.createParticleEmitter());
        this.factory = null;
      } catch (ResourceError e) {
        Log.error(e);
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  }

  public ParticlesEntity(float x, float y, Image particle,
      ConfigurableEmitter emitter, int maxParticles) {
    super(x, y);
    system = new ParticleSystem(particle);
    if (emitter != null)
      system.addEmitter(emitter.duplicate());
  }
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  public ParticleLayer() {
    this(null);
  }
 
  public ParticleLayer(String img) {
    fParticles = new ParticleSystem(PointClikiGame.resourceManager().image(img));
    fUpdater = new Minion<TimeEvent>(0) {
      @Override
      public long run(Dispatcher<TimeEvent> dispatcher, String type, TimeEvent event) {
        fParticles.update(event.delta());
        return Minion.CONTINUE;
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

    if (resp == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      File path = file.getParentFile();
     
      try {
        ParticleSystem system = ParticleIO.loadConfiguredSystem(file);
        game.setSystem(system);
        emitters.clear();
       
        for (int i=0;i<system.getEmitterCount();i++) {
          final ConfigurableEmitter emitter = (ConfigurableEmitter) system.getEmitter(i);
         
          if (emitter.getImageName() != null) {
            File possible = new File(path, emitter.getImageName());
            if (possible.exists()) {
              emitter.setImageName(possible.getAbsolutePath());
            } else {
              chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
              FileFilter filter = new FileFilter() {
                public boolean accept(File f) {
                  if (f.isDirectory()) {
                    return true;
                  }
                 
                  return (f.getName().equals(emitter.getImageName()));
                }
 
                public String getDescription() {
                  return emitter.getImageName();
                }
              };
             
              chooser.addChoosableFileFilter(filter);
              resp = chooser.showOpenDialog(this);
              if (resp == JFileChooser.APPROVE_OPTION) {
                File image = chooser.getSelectedFile();
                emitter.setImageName(image.getAbsolutePath());
                path = image.getParentFile();
              }
              chooser.setDialogTitle("Open");
              chooser.resetChoosableFileFilters();
              chooser.addChoosableFileFilter(xmlFileFilter);
            }
          }
         
          emitters.add(emitter);
        }
        additive.setSelected(system.getBlendingMode() == ParticleSystem.BLEND_ADDITIVE);
        pointsEnabled.setSelected(system.usePoints());
       
        emitters.setSelected(0);
      } catch (IOException e) {
        Log.error(e);
        JOptionPane.showMessageDialog(this, e.getMessage());
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

   *
   * @param additive
   *            True if the particle system should be set to additive
   */
  public void clearSystem(boolean additive) {
    system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
    if (additive) {
      system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
    }
    system.setRemoveCompletedEmitters(false);
  }
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  public void init(GameContainer container) throws SlickException {
    container.getInput().addListener(listener);
    container.setShowFPS(false);
   
    system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
    system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
    system.setRemoveCompletedEmitters(false);

    for (int i = 0; i < waiting.size(); i++) {
      system.addEmitter((ParticleEmitter) waiting.get(i));
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  /**
   * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
   */
  public void init(GameContainer container) throws SlickException {
    Image image = new Image("testdata/particle.tga", true);
    system = new ParticleSystem(image);
   
    system.addEmitter(new FireEmitter(400,300,45));
    system.addEmitter(new FireEmitter(200,300,60));
    system.addEmitter(new FireEmitter(600,300,30));
   
View Full Code Here

Examples of traer.physics.ParticleSystem

    super(parent, OUTPUT_W, OUTPUT_H);
   
    random = new Random();

    ps = new ParticleSystem( 0, 0, 0, particle_drag);

    // cada particula se conecta con el de abajo y el de la derecha
    particles   = new Particle[grid_HNodes][grid_VNodes];
    springs   = new Spring[(grid_HNodes) * (grid_VNodes)][2];                             

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.