Parallax docs examples use baseSpeed, fromParallax and other APIs that don't exist
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 91/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- documentation
Línea de trabajo
Abre doc/flame/components/parallax_component.md y compara los dos ejemplos con las referencias de API en packages/flame/lib/src/parallax.dart y parallax_component.dart, además de examples/lib/stories/parallax/advanced_parallax_example.dart. Actualiza los ejemplos para que usen las API y las formas documentadas. El trabajo estará terminado cuando ambos ejemplos compilen al copiarlos y ya no hagan referencia a API inexistentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What could be improved
Two examples in the Parallax docs (doc/flame/components/parallax_component.md, on main at 88c0438) use APIs that don't exist or have a different shape, so they don't compile when copied.
Runtime-update example (lines 66-75):
- The text and code use
baseSpeed, but the mutable field onParallaxisbaseVelocity(packages/flame/lib/src/parallax.dart:441). parallax.velocityMultiplierDelta = ...assigns a property that doesn't exist.velocityMultiplierDeltais only aParallax.loadargument (parallax.dart:514) used to set each layer'svelocityMultiplier.parallaxComponent.parallaxisParallax?(parallax_component.dart:71), so it needs a!before use.
Advanced example (lines 108-120):
await imagesits inside theimages.mapcallback, which isn'tasync.velocityMultiplier: images.indexOf(image) * 2.0passes adouble, but the parameter isVector2?(parallax.dart:243).ParallaxComponent.fromParallax(...)doesn't exist; the constructor isParallaxComponent(parallax: ...), asexamples/lib/stories/parallax/advanced_parallax_example.dartuses.
None of baseSpeed, layerDelta or fromParallax is defined anywhere in packages/flame/lib.
Why should this be improved
These are the examples people copy when they first set up a parallax, and each of them fails at compile time.
Risks
Docs only, no API change.
More information
The fix is small, about 8 lines in that one file: rename baseSpeed to baseVelocity in the text and code, drop the velocityMultiplierDelta assignment, use parallaxComponent.parallax!, mark the map callback async, pass Vector2(images.indexOf(image) * 2.0, 1.0), and use ParallaxComponent(parallax: Parallax(...)). Happy to send a PR once you're fine with it.
Prepared with AI assistance (Claude Code).
Other
- Are you interested in working on a PR for this?
- Lenguaje dominante
- Dart
- Estrellas
- 10.8k
- Forks
- 1.1k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 54
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flame-engine/flame
-
Add support to share the polygons of a Path among PathComponent and PathHitboxPosiblemente ocupada @adario la tomó hace 2 días. Abiertoenhancement
Dificultad 4/5 1-2 días Aptitud para principiantes 15/100
flame-engine/flame#4217 ·
Los mantenedores suelen responder en 1 día
-
`UniformsSetter.setColor` sends every color to the shader as blackPosiblemente ocupada @ufrshubham la tomó hace 4 días. Abiertobug
flame-engine/flame#4211 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes sizePosiblemente ocupada @ufrshubham la tomó hace 6 días. Abiertobug
flame-engine/flame#4204 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`Posiblemente ocupada @ufrshubham la tomó hace 6 días. Abiertobug
flame-engine/flame#4203 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resizedPosiblemente ocupada @ufrshubham la tomó hace 6 días. Abiertobug
flame-engine/flame#4202 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de flame-engine/flame
Issues similares
-
area-clientside-dartpad
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
TomBursch/kitchenowl#1211 ·
Los mantenedores suelen responder en 2 días
-
从「管理渠道」返回后,「选择模型」弹层仍然显示Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ccch1mneyyy/dsh-Go#767 ·
Los mantenedores suelen responder en 1 día