List of usage examples for com.badlogic.gdx.graphics.g2d ParticleEmitter getSpawnHeight
public ScaledNumericValue getSpawnHeight()
From source file:com.lynk.gdx.tool.particleeditor.ParticleEditor.java
License:Apache License
void reloadRows() { EventQueue.invokeLater(new Runnable() { public void run() { editRowsPanel.removeAll();/*w w w . ja v a2 s. co m*/ addEditorRow(new NumericPanel(pixelsPerMeter, "Pixels per meter", "")); 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(); } }); }
From source file:com.vlaaad.dice.ui.windows.SelectAbilityWindow.java
License:Open Source License
@Override protected void doShow(Params params) { this.params = params; Table content = new Table(Config.skin); content.defaults().pad(2);// w w w . j a va 2s.c o m content.setBackground("ui-inventory-ability-window-background"); table.add(content); TextButton button = new LocTextButton("ui-select"); Image itemSelection = new Image(Config.skin.getDrawable("ui-creature-info-ability-selection")); LocLabel itemDescriptionLabel = new LocLabel("ui-creature-info-window-ability-description", Thesaurus.params().with("name", params.abilities.first().locNameKey()).with("desc", params.abilities.first().locDescKey()), DESCRIPTION); itemDescriptionLabel.setWrap(true); itemDescriptionLabel.setAlignment(Align.center); Label label = new LocLabel("ui-select-ability-for-" + params.ability.name, Thesaurus.params().with("die", params.creature.description.nameLocKey())); label.setWrap(true); label.setAlignment(Align.center); content.add(label).width(110).row(); content.add(new Image(Config.skin, "ui-creature-info-line")).width(80).row(); int i = 0; Table row = new Table(); content.add(row).row(); for (Ability ability : params.abilities) { Group group = new Group(); AbilityIcon icon = new AbilityIcon(ability); group.addActor(icon); group.setSize(icon.getPrefWidth(), icon.getPrefHeight()); row.add(group); ClickListener clickListener = createListener(ability, button, itemSelection, group, itemDescriptionLabel); icon.addListener(clickListener); if (i == 0) { clickListener.clicked(null, 0, 0); } if (i % 3 == 2 && i != params.abilities.size - 1) { row = new Table(); content.add(row).row(); } i++; } content.add(new Image(Config.skin, "ui-creature-info-line")).width(80).row(); content.add(itemDescriptionLabel).width(ViewController.CELL_SIZE * 4 + 32).height(50).row(); content.add(button).padTop(6).padBottom(6).width(70); button.setDisabled(true); button.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { hide(); } }); particles = new ParticleActor(Config.particles.get("ability-concentration").obtain()); table.addActor(particles); table.layout(); particles.toBack(); particles.setPosition(content.getX() + content.getPrefWidth() / 2, content.getY() + content.getPrefHeight() / 2); for (ParticleEmitter emitter : particles.effect.getEmitters()) { emitter.getSpawnWidth().setHigh(content.getPrefWidth() + PARTICLE_OFFSET * 2); emitter.getSpawnHeight().setHigh(content.getPrefHeight() + PARTICLE_OFFSET * 2); } }
From source file:com.vlaaad.dice.ui.windows.SelectCreatureToResurrectWindow.java
License:Open Source License
@Override protected void doShow(SelectCreatureToResurrectWindow.Params params) { future = params.future;//from ww w .ja v a2 s . c o m selected = params.creatures.random(); Table content = new Table(Config.skin); content.setBackground("ui-inventory-ability-window-background"); content.defaults().pad(2); table.add(content); Label label = new LocLabel("ui-resurrect-header", Thesaurus.params().with("die", params.creature.description.nameLocKey())); label.setWrap(true); label.setAlignment(Align.center); content.add(label).width(110).row(); content.add(new Image(Config.skin, "ui-creature-info-line")).width(50).row(); Image selection = new Image(Config.skin.getDrawable("selection/turn")); selection.setY(-2); int i = 0; Table row = new Table(); content.add(row).padTop(16).row(); TextButton button = new LocTextButton("ui-select"); for (Creature creature : params.creatures) { WorldObjectView view = ViewController.createView(params.creature.world.viewer, params.creature.world.playerColors, creature); row.add(view).padLeft(2).padRight(2); view.addListener(createListener(creature, button, view, selection)); if (i % 4 == 3 && i != params.creatures.size - 1) { row = new Table(); content.add(row).padTop(16).row(); } i++; } content.add(button).padTop(6).padBottom(6).width(70); button.setDisabled(true); button.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { hide(); } }); particles = new ParticleActor(Config.particles.get("ability-concentration").obtain()); table.addActor(particles); table.layout(); particles.toBack(); particles.setPosition(content.getX() + content.getPrefWidth() / 2, content.getY() + content.getPrefHeight() / 2); for (ParticleEmitter emitter : particles.effect.getEmitters()) { emitter.getSpawnWidth().setHigh(content.getPrefWidth() + PARTICLE_OFFSET * 2); emitter.getSpawnHeight().setHigh(content.getPrefHeight() + PARTICLE_OFFSET * 2); } }