Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huang2002/hengine
A 2D graphic engine for javascript/typescript.
https://github.com/huang2002/hengine
2d-game-engine 3h canvas h5 hengine html5 javascript play typescript
Last synced: about 10 hours ago
JSON representation
A 2D graphic engine for javascript/typescript.
- Host: GitHub
- URL: https://github.com/huang2002/hengine
- Owner: huang2002
- License: mit
- Created: 2018-04-29T12:31:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-17T04:02:23.000Z (over 2 years ago)
- Last Synced: 2024-10-07T12:53:47.659Z (about 1 month ago)
- Topics: 2d-game-engine, 3h, canvas, h5, hengine, html5, javascript, play, typescript
- Language: TypeScript
- Homepage:
- Size: 631 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# hengine
> A simple graphic engine for `canvasom`.
## Links
- [Documentation](https://github.com/huang2002/hengine/wiki)
- [Changelog](./CHANGELOG.md)
- [License (MIT)](./LICENSE)## Example
```javascript
const engine = new HE.CanvasEngine({
interactive: true,
renderer: new COM.Renderer({
canvas: document.getElementById('canvas'),
width: 480,
height: 320,
ratio: 2,
}),
style: {
fillStyle: '#FFF',
},
resizerOptions: {
container: document.body,
padding: 10,
},
});const startScene = COM.create(HE.SceneNode, {
id: 'start-scene',
}, [
COM.create(COM.TextNode, {
stretch: 1,
content: 'hello world',
style: {
fillStyle: '#000',
textAlign: 'center',
textBaseline: 'middle',
},
}),
]);engine.enter(startScene);
engine.resizer.update(() => {
engine.updateAndRender();
});
```