我将LIBGDX的粒子效果与2个或更多发射器一起使用时遇到问题。
使用ParticleEditor创建我的.p文件后,我在代码BUT中使用它...当我仅使用1个发射器时,它很好,但超过1个,则不行! :(
这是我在Java控制台中的错误代码:
Exception in thread "LWJGL Application" java.lang.RuntimeException: Error parsing emitter: - Delay -
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:910)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.<init>(ParticleEmitter.java:95)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadEmitters(ParticleEffect.java:154)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.load(ParticleEffect.java:138)
at com.fasgame.fishtrip.android.screens.GameScreen.show(GameScreen.java:313)
at com.badlogic.gdx.Game.setScreen(Game.java:61)
at com.fasgame.fishtrip.android.screens.MainMenuScreen.render(MainMenuScreen.java:71)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:206)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: java.lang.NumberFormatException: For input string: "- Count -"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.readFloat(ParticleEmitter.java:929)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter$RangedNumericValue.load(ParticleEmitter.java:1062)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:866)
... 9 more
这是我的粒子效果.p文件:
Blanc
- Delay -
active: false
- Duration -
lowMin: 3000.0
lowMax: 3000.0
- Count -
min: 0
max: 200
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 250.0
highMax: 250.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 500.0
lowMax: 500.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 0.47058824
scaling2: 0.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.51369864
timeline2: 1.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 70.0
highMax: 70.0
relative: true
scalingCount: 2
scaling0: 1.0
scaling1: 0.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Velocity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 30.0
highMax: 300.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Angle -
active: true
lowMin: 220.0
lowMax: 320.0
highMin: 220.0
highMax: 320.0
relative: false
scalingCount: 2
scaling0: 0.0
scaling1: 0.98039216
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Rotation -
active: false
- Wind -
active: false
- Gravity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Tint -
colorsCount: 3
colors0: 0.50980395
colors1: 0.7647059
colors2: 0.7921569
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 4
scaling0: 1.0
scaling1: 1.0
scaling2: 1.0
scaling3: 1.0
timelineCount: 4
timeline0: 0.0
timeline1: 0.36301368
timeline2: 0.6164383
timeline3: 1.0
- Options -
attached: false
continuous: true
aligned: false
additive: true
behind: false
premultipliedAlpha: false
pre_particle.png
Bleu
- Delay -
active: false
- Duration -
lowMin: 3000.0
lowMax: 3000.0
- Count -
min: 0
max: 200
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 250.0
highMax: 250.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 500.0
lowMax: 500.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 0.47058824
scaling2: 0.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.51369864
timeline2: 1.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 70.0
highMax: 70.0
relative: true
scalingCount: 2
scaling0: 1.0
scaling1: 0.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Velocity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 30.0
highMax: 300.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Angle -
active: true
lowMin: 220.0
lowMax: 320.0
highMin: 220.0
highMax: 320.0
relative: false
scalingCount: 2
scaling0: 0.0
scaling1: 0.98039216
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Rotation -
active: false
- Wind -
active: false
- Gravity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Tint -
colorsCount: 3
colors0: 0.0
colors1: 0.7254902
colors2: 0.7921569
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 6
scaling0: 0.0
scaling1: 1.0
scaling2: 1.0
scaling3: 1.0
scaling4: 1.0
scaling5: 0.0
timelineCount: 6
timeline0: 0.0
timeline1: 0.047945205
timeline2: 0.34246576
timeline3: 0.6712329
timeline4: 0.94520545
timeline5: 1.0
- Options -
attached: false
continuous: true
aligned: false
additive: true
behind: false
premultipliedAlpha: false
pre_particle.png
BleuFonce
- Delay -
active: false
- Duration -
lowMin: 3000.0
lowMax: 3000.0
- Count -
min: 0
max: 200
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 250.0
highMax: 250.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 500.0
lowMax: 500.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 0.47058824
scaling2: 0.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.51369864
timeline2: 1.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 70.0
highMax: 70.0
relative: true
scalingCount: 2
scaling0: 1.0
scaling1: 0.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Velocity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 30.0
highMax: 300.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Angle -
active: true
lowMin: 220.0
lowMax: 320.0
highMin: 220.0
highMax: 320.0
relative: false
scalingCount: 2
scaling0: 0.0
scaling1: 0.98039216
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Rotation -
active: false
- Wind -
active: false
- Gravity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Tint -
colorsCount: 3
colors0: 0.0
colors1: 0.7294118
colors2: 1.0
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 4
scaling0: 1.0
scaling1: 0.0
scaling2: 0.0
scaling3: 1.0
timelineCount: 4
timeline0: 0.0
timeline1: 0.001
timeline2: 0.5753425
timeline3: 0.79452056
- Options -
attached: false
continuous: true
aligned: false
additive: true
behind: false
premultipliedAlpha: false
pre_particle.png
对于“-图像路径-”缺失,如果我让它们进入,即使只有1个发射器也不起作用,这是正常的
PS:我已经将我的库更新到最新版本
最佳答案
我通过打开粒子效果文件并删除表示以下内容的行来修复该问题:
- Image Path -
确保您使用的粒子编辑器的版本与项目中的LibGdx相同。