@bornengine/engine 0.4.16 → 0.5.1

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.
Files changed (62) hide show
  1. package/README.md +24 -14
  2. package/native/android/Cargo.lock +577 -28
  3. package/native/android/Cargo.toml +2 -0
  4. package/native/android/src/lib.rs +39 -3
  5. package/native/ios/Cargo.lock +573 -24
  6. package/native/ios/Cargo.toml +2 -0
  7. package/native/ios/src/lib.rs +72 -9
  8. package/native/ios/src/text_input.rs +48 -0
  9. package/native/linux/Cargo.lock +623 -35
  10. package/native/linux/Cargo.toml +3 -0
  11. package/native/macos/Cargo.lock +630 -35
  12. package/native/macos/Cargo.toml +3 -0
  13. package/native/shared/Cargo.lock +430 -27
  14. package/native/shared/Cargo.toml +5 -0
  15. package/native/shared/build.rs +41 -1
  16. package/native/shared/src/engine.rs +54 -2
  17. package/native/shared/src/ffi.rs +54 -1
  18. package/native/shared/src/ffi_core/mod.rs +2 -0
  19. package/native/shared/src/ffi_core/ui.rs +182 -0
  20. package/native/shared/src/input.rs +317 -12
  21. package/native/shared/src/lib.rs +1 -0
  22. package/native/shared/src/renderer/mod.rs +47 -201
  23. package/native/shared/src/renderer/texture_store.rs +5 -0
  24. package/native/shared/src/renderer/ui_pass.rs +742 -0
  25. package/native/shared/src/textures.rs +2 -0
  26. package/native/shared/src/ui/commands.rs +213 -0
  27. package/native/shared/src/ui/egui.rs +1282 -0
  28. package/native/shared/src/ui/imgui.rs +1056 -0
  29. package/native/shared/src/ui/input.rs +173 -0
  30. package/native/shared/src/ui/mod.rs +252 -0
  31. package/native/shared/src/ui/responses.rs +61 -0
  32. package/native/tvos/Cargo.lock +576 -27
  33. package/native/tvos/Cargo.toml +2 -0
  34. package/native/visionos/Cargo.lock +571 -22
  35. package/native/visionos/Cargo.toml +2 -0
  36. package/native/watchos/src/ffi_stubs.rs +27 -0
  37. package/native/web/Cargo.lock +346 -11
  38. package/native/web/Cargo.toml +6 -0
  39. package/native/web/bloom_glue.js +84 -11
  40. package/native/web/build.sh +150 -34
  41. package/native/web/src/lib.rs +2 -0
  42. package/native/web/src/ui_ffi.rs +148 -0
  43. package/native/windows/Cargo.lock +638 -38
  44. package/native/windows/Cargo.toml +3 -0
  45. package/native/windows/src/lib.rs +50 -1
  46. package/native/windows/src/windows_text.rs +69 -0
  47. package/package.json +91 -2
  48. package/src/debug-ui/index.ts +4 -0
  49. package/src/debug-ui/types.ts +1 -0
  50. package/src/game/adapters/audio-source-component.ts +67 -0
  51. package/src/game/adapters/rigid-body-component.ts +69 -0
  52. package/src/game/adapters/scene-node-component.ts +49 -0
  53. package/src/game/game-component.ts +89 -0
  54. package/src/game/game-object.ts +338 -0
  55. package/src/game/game-scene.ts +303 -0
  56. package/src/game/index.ts +7 -0
  57. package/src/game/transform.ts +315 -0
  58. package/src/index.ts +27 -0
  59. package/src/ui/api.ts +240 -0
  60. package/src/ui/index.ts +5 -0
  61. package/src/ui/opcodes.ts +66 -0
  62. package/src/ui/types.ts +82 -0
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # BornEngine
2
2
 
3
+ <p align="center">
4
+ <img src="webpage/public/brand/bornengine-mark.png" alt="BornEngine mark" width="96">
5
+ </p>
6
+
3
7
  **Native games from TypeScript.**
4
8
 
5
9
  Write TypeScript. Ship native games — and now the web too.
@@ -71,13 +75,15 @@ drawText("Hello, BornEngine!", 190, 200, 20, Colors.DARKGRAY);
71
75
  Build for web:
72
76
 
73
77
  ```bash
74
- ./native/web/build.sh main.ts
78
+ ./native/web/build.sh --dev main.ts
75
79
  cd dist/web && python3 -m http.server 8080
76
80
  ```
77
81
 
82
+ Use `--release` (the default) for optimized builds.
83
+
78
84
  ## Features
79
85
 
80
- - **Simple API** — Functions, not classes. The entire API fits on a cheatsheet. ([design rationale](docs/design-api.md))
86
+ - **Two gameplay styles** — Use the flat function-and-handle API directly, or build with the optional class-based GameObject runtime. ([design rationale](docs/design-api.md), [game objects](docs/game-objects.md))
81
87
  - **True native** — Compiles to Metal, DirectX 12, Vulkan, OpenGL, and WebGPU via wgpu.
82
88
  - **Ship everywhere** — macOS, Windows, Linux, iOS, tvOS, Android, and Web from one codebase.
83
89
  - **Unified 2D/3D** — Shapes, textures, text, 3D models, and audio in one engine.
@@ -85,10 +91,11 @@ cd dist/web && python3 -m http.server 8080
85
91
 
86
92
  ## How BornEngine relates to raylib
87
93
 
88
- BornEngine's public API is heavily inspired by [raylib](https://github.com/raysan5/raylib).
94
+ BornEngine's low-level modules are heavily inspired by [raylib](https://github.com/raysan5/raylib).
89
95
  raylib's API is, in our opinion, one of the best in the gamedev space — a flat library
90
- of plain functions, no classes, small enough to learn from a cheatsheet — so we model
91
- ours on it. You'll recognize the shape immediately: `initWindow`, `beginDrawing`,
96
+ of plain functions, small enough to learn from a cheatsheet — so those modules follow
97
+ that shape. The optional game module adds class-based gameplay objects. You'll recognize
98
+ the low-level API immediately: `initWindow`, `beginDrawing`,
92
99
  `clearBackground`, `drawText`, and modules named core / shapes / textures / text /
93
100
  audio / models.
94
101
 
@@ -105,6 +112,7 @@ setting the bar. ([full design rationale](docs/design-api.md))
105
112
  | Module | Import | Description |
106
113
  |--------|--------|-------------|
107
114
  | **Core** | `@bornengine/engine/core` | Window, game loop, input, timing |
115
+ | **Game** | `@bornengine/engine/game` | GameObjects, components, transforms, scenes, and native-handle adapters ([docs](docs/game-objects.md)) |
108
116
  | **Shapes** | `@bornengine/engine/shapes` | 2D drawing + collision detection |
109
117
  | **Textures** | `@bornengine/engine/textures` | Image loading, sprite batching |
110
118
  | **Text** | `@bornengine/engine/text` | TTF/OTF font loading and rendering |
@@ -135,6 +143,7 @@ setting the bar. ([full design rationale](docs/design-api.md))
135
143
  ```
136
144
  src/ TypeScript API
137
145
  core/ Window, input, game loop
146
+ game/ GameObjects, components, transforms, adapters
138
147
  shapes/ 2D shapes + collision
139
148
  textures/ Image loading, sprites
140
149
  text/ Font rendering
@@ -156,9 +165,9 @@ examples/
156
165
  pong/ Complete working example (~170 lines)
157
166
  ```
158
167
 
159
- ## Types
168
+ ## Core data types
160
169
 
161
- Plain interfaces, no classes:
170
+ The native function modules use plain data interfaces and numeric resource handles:
162
171
 
163
172
  ```typescript
164
173
  interface Vec2 { x: number; y: number }
@@ -215,17 +224,18 @@ Key functions:
215
224
 
216
225
  For the full pipeline (Blender export, pitfalls, architecture), see [docs/skeletal-animation.md](docs/skeletal-animation.md).
217
226
 
218
- ## Made with Bloom
227
+ ## Built with the original Bloom Engine
219
228
 
220
- **[Bloom Jump](https://apps.apple.com/us/app/bloom-jump/id6761447092)** — our first shipped game and a proof point for the engine. A free retro pixel platformer with five hand-crafted levels, 60 FPS, and an original chiptune soundtrack, built entirely with Bloom from one TypeScript codebase running natively on every target.
229
+ **[Bloom Jump](https://apps.apple.com/us/app/bloom-jump/id6761447092)** was released under the original Bloom Engine name before this fork continued as BornEngine. It remains a historical Bloom-branded release, not a BornEngine-branded game. It's a free retro pixel platformer with five hand-crafted levels, 60 FPS, and an original chiptune soundtrack, built from one TypeScript codebase.
221
230
 
222
231
  - [App Store](https://apps.apple.com/us/app/bloom-jump/id6761447092) — iOS, macOS, tvOS, and visionOS
223
232
  - [App Store (watchOS)](https://apps.apple.com/us/app/bloom-jump-watch/id6779528549) — Apple Watch
224
233
  - [Google Play](https://play.google.com/store/apps/details?id=com.bloom.jump) — Android
225
234
 
226
- ## Links
235
+ ## BornEngine links
227
236
 
228
- - [bloomengine.dev](https://bloomengine.dev)
229
- - [Docs](https://bloomengine.dev/docs)
230
- - [Showcase](https://bloomengine.dev/showcase)
231
- - [Brand Guidelines](https://github.com/Bloom-Engine/brand)
237
+ - [Source repository](https://github.com/RuanFernandes/BornEngine)
238
+ - [npm package](https://www.npmjs.com/package/@bornengine/engine)
239
+ - [Documentation](docs/)
240
+ - [Website and guides](https://ruanfernandes.github.io/BornEngine/)
241
+ - [BornEngine CLI](https://github.com/RuanFernandes/bornengine-cli)