Skip to content

Commit b2be745

Browse files
committed
🧹 Clean up examples
1 parent f1d5502 commit b2be745

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed

Examples/ParticlesExample/ParticlesExample/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct ContentView: View {
1616
List {
1717
Text("Presets").font(.headline).foregroundStyle(.secondary)
1818
NavigationLink("Comet", destination: CometView.init)
19-
NavigationLink("Ghost Rider", destination: GhostRiderView.init)
19+
// NavigationLink("Ghost Rider", destination: GhostRiderView.init)
2020
NavigationLink("Fire", destination: FireView.init)
2121
NavigationLink("Snow", destination: SnowView.init)
2222
NavigationLink("Smoke", destination: SmokeView.init)

Examples/ParticlesExample/ParticlesExample/View/SmokeView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ struct SmokeView: View {
1919
Preset.Smoke(dirty: dirty)
2020
}
2121
.statePersistent("smoke")
22-
HStack {
23-
Toggle("Dirty Smoke", isOn: $dirty)
24-
}
25-
.padding()
22+
// HStack {
23+
// Toggle("Dirty Smoke", isOn: $dirty)
24+
// }
25+
// .padding()
2626
}
2727
}
2828
}

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ ParticleSystem {
213213
}
214214
```
215215

216-
> [!WARNING]
217-
> Particles is in **Pre-Release**. While the API for `Lattice` is to remain unchanged, there is a known performance issue with this entity. `Lattice` uses an expensive initializer that can cause a delay in appearance. This will be optimized before release.
216+
> [!TIP]
217+
> You can choose to have the lattice spawn particles along a view's edge by passing `Lattice(hugging:)`.
218218
219219
## Defining Entities
220220

@@ -262,17 +262,21 @@ Like SwiftUI modifiers, *most*\* entity modifiers are applied *outside first*, *
262262

263263
### List of Entity Modifiers
264264

265+
For more information on modifier parameters, see symbol documentation.
266+
265267
- Lifetime
266268
- `.lifetime(...)`
267269
- Position and Offset
268270
- `.initialPosition(...)`
269271
- `.initialOffset(...)`
270272
- `.fixPosition(...)`
273+
- `.zIndex(...)`
271274
- Velocity and Acceleration
272275
- `.initialVelocity(...)`
273276
- `.fixVelocity(...)`
274277
- `.initialAcceleration(...)`
275278
- `.fixAcceleration(...)`
279+
- `.drag(...)`
276280
- Rotation and Torque
277281
- `.initialRotation(...)`
278282
- `.fixRotation(...)`
@@ -288,8 +292,9 @@ Like SwiftUI modifiers, *most*\* entity modifiers are applied *outside first*, *
288292
- `.scale(...)`
289293
- `.glow(...)`
290294
- `.shader(...)`
291-
- Transitions
295+
- Transitions and Timing
292296
- `.transition(_:on:duration:)`
297+
- `.delay(...)`
293298
- Custom Behavior
294299
- `.onAppear(perform:)`
295300
- `.onUpdate(perform:)`
@@ -315,6 +320,39 @@ All modifiers are documented with parameter information.
315320

316321
> [!WARNING]
317322
> Particles is in **Pre-Release**. The API for the four view modifiers listed above may be changed before release.
323+
324+
### Custom Behavior Closures
325+
326+
Some modifier parameters take in a closure of the form `(Proxy.Context) -> <Type>`. [`Proxy.Context`](Sources/Particles/API/Proxy.swift#L68-L89) provides information about the current proxy and the system it lives in.
327+
328+
Below is a list of properties of `Proxy.Context`. All symbols are documented.
329+
330+
- `proxy: Proxy`
331+
- `.position: CGPoint`
332+
- `.velocity: CGVector`
333+
- `.acceleration: CGVector`
334+
- `.drag: Double`
335+
- `.rotation: Angle`
336+
- `.torque: Angle`
337+
- `.rotation3d: SIMD3<Double>`
338+
- `.zIndex: Int`
339+
- `.lifetime: Double`
340+
- `.seed: (Double, Double, Double, Double)`
341+
- `.opacity: Double`
342+
- `.hueRotation: Angle`
343+
- `.blur: CGFloat`
344+
- `.scale: CGSize`
345+
- `.blendMode: GraphicsContext.BlendMode`
346+
- `system: ParticleSystem.Data`
347+
- `.debug: Bool`
348+
- `.size: CGSize`
349+
- `.currentFrame: UInt`
350+
- `.lastFrameUpdate`
351+
- `.touches` (iOS)
352+
- `.time: TimeInterval`
353+
- `.proxiesAlive`
354+
- `.proxiesSpawned`
355+
- `.averageFrameRate`
318356

319357
## State Persistence
320358

0 commit comments

Comments
 (0)