LIBGDX "источник ошибок разбора" с двумя или более источниками
У меня проблема с использованием эффекта частиц LIBGDX с двумя или более излучателями.
После использования ParticleEditor для создания моего.p файла я использую его в своем коде, НО... когда я использую только 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
Для пропущенного "- Image Path -" это нормально, если я позволю им в этом не работать, даже если только 1 излучатель
PS: я уже обновил мою библиотеку до последнего выпуска
2 ответа
Я исправил это, открыв файл эффекта частиц и удалив строки, которые говорили:
- Image Path -
Убедитесь, что сборка редактора частиц, который вы используете, такая же, как и LibGdx в вашем проекте.
Вы не должны получить это, если вы используете тот же ParticleEditor в вашей библиотеке инструментов (это была ошибка, которую я сделал).
Попробуйте удалить spriteMode: single
и меняется - Image Paths -
в - Image Path -
,