modern-canvas 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,7 +27,7 @@ npm i modern-canvas
27
27
  ## 🦄 Usage
28
28
 
29
29
  ```javascript
30
- import { Animation2D, Engine, Image2D, Text2D } from 'modern-canvas'
30
+ import { Animation, Engine, Image2D, Text2D } from 'modern-canvas'
31
31
  import { fonts } from 'modern-font'
32
32
 
33
33
  async function loadFallbackFont() {
@@ -50,25 +50,22 @@ loadFallbackFont().then(() => {
50
50
  filter: 'brightness(102%) contrast(90%) saturate(128%) sepia(18%)',
51
51
  },
52
52
  src: '/example.png',
53
- })
54
- .addChild(
55
- new Text2D({
56
- fonts,
57
- style: {
58
- fontSize: 30,
59
- },
60
- content: '/example.png',
61
- }),
62
- )
63
- .addChild(
64
- new Animation2D({
65
- duration: 3000,
66
- loop: true,
67
- keyframes: [
68
- { offset: 1, rotate: 180 },
69
- ],
70
- }),
71
- )
53
+ }, [
54
+ new Animation({
55
+ duration: 3000,
56
+ loop: true,
57
+ keyframes: [
58
+ { offset: 1, rotate: 180 },
59
+ ],
60
+ }),
61
+ new Text2D({
62
+ fonts,
63
+ style: {
64
+ fontSize: 30,
65
+ },
66
+ content: '/example.png',
67
+ }),
68
+ ])
72
69
  )
73
70
 
74
71
  console.log(engine)
@@ -77,9 +74,9 @@ loadFallbackFont().then(() => {
77
74
  })
78
75
  ```
79
76
 
80
- ## Effect
77
+ ## Effects
81
78
 
82
- See the [effect](./src/effect)
79
+ See the [scene/effects](./src/scene/effects)
83
80
 
84
81
  ```typescript
85
82
  import { EmbossEffect, Image2D } from 'modern-canvas'
@@ -87,9 +84,8 @@ import { EmbossEffect, Image2D } from 'modern-canvas'
87
84
  engine.root.addChild(
88
85
  new Image2D({
89
86
  src: '/example.png',
90
- })
91
- .addChild(
92
- new EmbossEffect(),
93
- )
87
+ }, [
88
+ new EmbossEffect(),
89
+ ])
94
90
  )
95
91
  ```