Package com.badlogic.gdx.graphics.g2d

Examples of com.badlogic.gdx.graphics.g2d.ParticleEmitter$RangedNumericValue


    // ========

    sr = new ShapeRenderer();

    followerParticle = new ParticleEmitter();

    try {
      followerParticle.load(Gdx.files.internal("data/fx/particle").reader(2024));
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here


    bulletTexture = new Texture("data/bullet.png");
    bulletTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
   
    sr = new ShapeRenderer();
   
    exhaust = new ParticleEmitter();
   
    try {
      exhaust.load(Gdx.files.internal("data/exhaust").reader(2024));
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

        addEditorRow(new NumericPanel(zoomLevel, "Zoom level", ""));
        addEditorRow(new NumericPanel(deltaMultiplier, "Delta multiplier", ""));
        addEditorRow(new GradientPanel(backgroundColor, "Background color", "", true));

        rowsPanel.removeAll();
        ParticleEmitter emitter = getEmitter();
        addRow(new ImagePanel(ParticleEditor.this, "Image", ""));
        addRow(new CountPanel(ParticleEditor.this, "Count",
          "Min number of particles at all times, max number of particles allowed."));
        addRow(new RangedNumericPanel(emitter.getDelay(), "Delay",
          "Time from beginning of effect to emission start, in milliseconds."));
        addRow(new RangedNumericPanel(emitter.getDuration(), "Duration", "Time particles will be emitted, in milliseconds."));
        addRow(new ScaledNumericPanel(emitter.getEmission(), "Duration", "Emission",
          "Number of particles emitted per second."));
        addRow(new ScaledNumericPanel(emitter.getLife(), "Duration", "Life", "Time particles will live, in milliseconds."));
        addRow(new ScaledNumericPanel(emitter.getLifeOffset(), "Duration", "Life Offset",
          "Particle starting life consumed, in milliseconds."));
        addRow(new RangedNumericPanel(emitter.getXOffsetValue(), "X Offset",
          "Amount to offset a particle's starting X location, in world units."));
        addRow(new RangedNumericPanel(emitter.getYOffsetValue(), "Y Offset",
          "Amount to offset a particle's starting Y location, in world units."));
        addRow(new SpawnPanel(ParticleEditor.this, emitter.getSpawnShape(), "Spawn", "Shape used to spawn particles."));
        addRow(new ScaledNumericPanel(emitter.getSpawnWidth(), "Duration", "Spawn Width",
          "Width of the spawn shape, in world units."));
        addRow(new ScaledNumericPanel(emitter.getSpawnHeight(), "Duration", "Spawn Height",
          "Height of the spawn shape, in world units."));
        addRow(new ScaledNumericPanel(emitter.getScale(), "Life", "Size", "Particle size, in world units."));
        addRow(new ScaledNumericPanel(emitter.getVelocity(), "Life", "Velocity", "Particle speed, in world units per second."));
        addRow(new ScaledNumericPanel(emitter.getAngle(), "Life", "Angle", "Particle emission angle, in degrees."));
        addRow(new ScaledNumericPanel(emitter.getRotation(), "Life", "Rotation", "Particle rotation, in degrees."));
        addRow(new ScaledNumericPanel(emitter.getWind(), "Life", "Wind", "Wind strength, in world units per second."));
        addRow(new ScaledNumericPanel(emitter.getGravity(), "Life", "Gravity", "Gravity strength, in world units per second."));
        addRow(new GradientPanel(emitter.getTint(), "Tint", "", false));
        addRow(new PercentagePanel(emitter.getTransparency(), "Life", "Transparency", ""));
        addRow(new OptionsPanel(ParticleEditor.this, "Options", ""));
        for (Component component : rowsPanel.getComponents())
          if (component instanceof EditorPanel) ((EditorPanel)component).update(ParticleEditor.this);
        rowsPanel.repaint();
      }
View Full Code Here

    this.editor = editor;
    initializeComponents();
  }

  public ParticleEmitter newEmitter (String name, boolean select) {
    final ParticleEmitter emitter = new ParticleEmitter();

    emitter.getDuration().setLow(1000);
    emitter.getEmission().setHigh(50);
    emitter.getLife().setHigh(500);
    emitter.getScale().setHigh(32, 32);

    emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});
    emitter.getTransparency().setHigh(1);

    emitter.setMaxParticleCount(25);
    emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE);

    addEmitter(name, select, emitter);
    return emitter;
  }
View Full Code Here

    addEmitter(name, select, emitter);
    return emitter;
  }

  public ParticleEmitter newExampleEmitter (String name, boolean select) {
    final ParticleEmitter emitter = new ParticleEmitter();

    emitter.getDuration().setLow(3000);

    emitter.getEmission().setHigh(250);

    emitter.getLife().setHigh(500, 1000);
    emitter.getLife().setTimeline(new float[] {0, 0.66f, 1});
    emitter.getLife().setScaling(new float[] {1, 1, 0.3f});

    emitter.getScale().setHigh(32, 32);

    emitter.getRotation().setLow(1, 360);
    emitter.getRotation().setHigh(180, 180);
    emitter.getRotation().setTimeline(new float[] {0, 1});
    emitter.getRotation().setScaling(new float[] {0, 1});
    emitter.getRotation().setRelative(true);

    emitter.getAngle().setHigh(45, 135);
    emitter.getAngle().setLow(90);
    emitter.getAngle().setTimeline(new float[] {0, 0.5f, 1});
    emitter.getAngle().setScaling(new float[] {1, 0, 0});
    emitter.getAngle().setActive(true);

    emitter.getVelocity().setHigh(30, 300);
    emitter.getVelocity().setActive(true);

    emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});

    emitter.getTransparency().setHigh(1, 1);
    emitter.getTransparency().setTimeline(new float[] {0, 0.2f, 0.8f, 1});
    emitter.getTransparency().setScaling(new float[] {0, 1, 0.75f, 0});

    emitter.setMaxParticleCount(200);
    emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE);

    addEmitter(name, select, emitter);
    return emitter;
  }
View Full Code Here

  private void addEmitter (String name, boolean select, final ParticleEmitter emitter) {
    Array<ParticleEmitter> emitters = editor.effect.getEmitters();
    if (emitters.size == 0)
      emitter.setPosition(editor.worldCamera.viewportWidth / 2, editor.worldCamera.viewportHeight / 2);
    else {
      ParticleEmitter p = emitters.get(0);
      emitter.setPosition(p.getX(), p.getY());
    }
    emitters.add(emitter);

    emitterTableModel.addRow(new Object[] {name, true});
    if (select) {
View Full Code Here

    int row = emitterTable.getSelectedRow();
    if (row == -1) return;
   
    String name = (String)emitterTableModel.getValueAt(row, 0);
   
    addEmitter(name, true, new ParticleEmitter(editor.effect.getEmitters().get(row)));
  }
View Full Code Here

    Array<ParticleEmitter> emitters = editor.effect.getEmitters();
    if (direction > 0 && editIndex == emitters.size - 1) return;
    int insertIndex = editIndex + direction;
    Object name = emitterTableModel.getValueAt(editIndex, 0);
    emitterTableModel.removeRow(editIndex);
    ParticleEmitter emitter = emitters.removeIndex(editIndex);
    emitterTableModel.insertRow(insertIndex, new Object[] {name});
    emitters.insert(insertIndex, emitter);
    editIndex = insertIndex;
    emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex);
  }
View Full Code Here

      public void actionPerformed (ActionEvent event) {
        editor.getEmitter().setPremultipliedAlpha(premultipliedAlphaCheckbox.isSelected());
      }
    });

    ParticleEmitter emitter = editor.getEmitter();
    attachedCheckBox.setSelected(emitter.isAttached());
    continuousCheckbox.setSelected(emitter.isContinuous());
    alignedCheckbox.setSelected(emitter.isAligned());
    additiveCheckbox.setSelected(emitter.isAdditive());
    behindCheckbox.setSelected(emitter.isBehind());
    premultipliedAlphaCheckbox.setSelected(emitter.isPremultipliedAlpha());
  }
View Full Code Here

          final String dir = dialog.getDirectory();
          if (dir == null || file == null || file.trim().length() == 0) return;
          lastDir = dir;
          try {
            ImageIcon icon = new ImageIcon(new File(dir, file).toURI().toURL());
            final ParticleEmitter emitter = editor.getEmitter();
            editor.setIcon(emitter, icon);
            updateIconInfo(icon);
            emitter.setImagePath(new File(dir, file).getAbsolutePath());
            emitter.setSprite(null);
          } catch (Exception ex) {
            ex.printStackTrace();
          }
        }
      });
    }
    {
      JButton defaultButton = new JButton("Default");
      contentPanel.add(defaultButton, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
        GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));
      defaultButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed (ActionEvent e) {
          final ParticleEmitter emitter = editor.getEmitter();
          emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE);
          emitter.setSprite(null);

          editor.setIcon(emitter, null);
          updateIconInfo(null);
        }
      });
      JButton defaultPremultButton = new JButton("Default (Premultiplied Alpha)");
      contentPanel.add(defaultPremultButton, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
        GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));
      defaultPremultButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed (ActionEvent e) {
          final ParticleEmitter emitter = editor.getEmitter();
          emitter.setImagePath(ParticleEditor.DEFAULT_PREMULT_PARTICLE);
          emitter.setSprite(null);
          editor.setIcon(emitter, null);
          updateIconInfo(null);
        }
      });
    }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.g2d.ParticleEmitter$RangedNumericValue

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.