@penabt/pixi-expo 0.1.0 → 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 +19 -21
- package/dist/index.d.mts +747 -0
- package/dist/index.d.ts +747 -0
- package/dist/index.js +1815 -0
- package/dist/index.mjs +1771 -0
- package/package.json +94 -94
- package/src/adapter/ExpoAdapter.ts +215 -215
- package/src/adapter/ExpoCanvasElement.ts +427 -381
- package/src/adapter/index.ts +17 -10
- package/src/adapter/loadExpoAsset.ts +117 -134
- package/src/adapter/loadExpoFont.ts +83 -85
- package/src/adapter/polyfills.ts +460 -247
- package/src/components/PixiView.tsx +482 -273
- package/src/example/App.tsx +179 -191
- package/src/index.ts +178 -158
- package/src/utils/touchEventBridge.ts +296 -0
package/README.md
CHANGED
|
@@ -34,10 +34,8 @@ import { PixiView, Graphics, Application } from '@penabt/pixi-expo';
|
|
|
34
34
|
export default function GameScreen() {
|
|
35
35
|
const handleAppCreate = (app: Application) => {
|
|
36
36
|
// Create a red circle
|
|
37
|
-
const circle = new Graphics()
|
|
38
|
-
|
|
39
|
-
.fill({ color: 0xff0000 });
|
|
40
|
-
|
|
37
|
+
const circle = new Graphics().circle(0, 0, 50).fill({ color: 0xff0000 });
|
|
38
|
+
|
|
41
39
|
circle.position.set(200, 300);
|
|
42
40
|
app.stage.addChild(circle);
|
|
43
41
|
|
|
@@ -72,13 +70,13 @@ The main component for rendering PixiJS content.
|
|
|
72
70
|
|
|
73
71
|
```tsx
|
|
74
72
|
<PixiView
|
|
75
|
-
style={ViewStyle}
|
|
76
|
-
backgroundColor={0x000000}
|
|
77
|
-
resolution={1}
|
|
78
|
-
antialias={true}
|
|
79
|
-
onApplicationCreate={(app) => {}}
|
|
80
|
-
onContextCreate={(gl) => {}}
|
|
81
|
-
onError={(error) => {}}
|
|
73
|
+
style={ViewStyle} // Container styles
|
|
74
|
+
backgroundColor={0x000000} // Background color (hex)
|
|
75
|
+
resolution={1} // Device pixel ratio
|
|
76
|
+
antialias={true} // Enable antialiasing
|
|
77
|
+
onApplicationCreate={(app) => {}} // Called when app is ready
|
|
78
|
+
onContextCreate={(gl) => {}} // Called when GL context created
|
|
79
|
+
onError={(error) => {}} // Called on initialization error
|
|
82
80
|
/>
|
|
83
81
|
```
|
|
84
82
|
|
|
@@ -118,27 +116,27 @@ import {
|
|
|
118
116
|
AnimatedSprite,
|
|
119
117
|
Mesh,
|
|
120
118
|
NineSliceSprite,
|
|
121
|
-
|
|
119
|
+
|
|
122
120
|
// Textures
|
|
123
121
|
Texture,
|
|
124
122
|
RenderTexture,
|
|
125
123
|
Assets,
|
|
126
|
-
|
|
124
|
+
|
|
127
125
|
// Geometry
|
|
128
126
|
Matrix,
|
|
129
127
|
Point,
|
|
130
128
|
Rectangle,
|
|
131
129
|
Circle,
|
|
132
130
|
Polygon,
|
|
133
|
-
|
|
131
|
+
|
|
134
132
|
// Filters
|
|
135
133
|
Filter,
|
|
136
134
|
BlurFilter,
|
|
137
135
|
ColorMatrixFilter,
|
|
138
|
-
|
|
136
|
+
|
|
139
137
|
// Animation
|
|
140
138
|
Ticker,
|
|
141
|
-
|
|
139
|
+
|
|
142
140
|
// And more...
|
|
143
141
|
} from '@penabt/pixi-expo';
|
|
144
142
|
```
|
|
@@ -182,11 +180,11 @@ const texture = await Assets.load('https://example.com/sprite.png');
|
|
|
182
180
|
|
|
183
181
|
## Compatibility
|
|
184
182
|
|
|
185
|
-
| Package
|
|
186
|
-
|
|
187
|
-
| pixi.js
|
|
188
|
-
| expo
|
|
189
|
-
| expo-gl
|
|
183
|
+
| Package | Version |
|
|
184
|
+
| ------------ | -------- |
|
|
185
|
+
| pixi.js | ≥ 8.0.0 |
|
|
186
|
+
| expo | ≥ 50.0.0 |
|
|
187
|
+
| expo-gl | ≥ 14.0.0 |
|
|
190
188
|
| react-native | ≥ 0.73.0 |
|
|
191
189
|
|
|
192
190
|
## Contributing
|