Skip to content

Commit

Permalink
Merge pull request #2 from Deseteral/next-release
Browse files Browse the repository at this point in the history
Version 1.1
  • Loading branch information
Deseteral authored Sep 27, 2023
2 parents 42deac1 + 8c18ea4 commit fe870da
Show file tree
Hide file tree
Showing 14 changed files with 2,580 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
imgui-js/
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "imgui-js"]
path = imgui-js
url = https://github.com/flyover/imgui-js.git
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2023-09-28
- Added ImGui

## [1.0.0] - 2023-02-04
- Initial release

[unreleased]: https://github.com/Deseteral/ponczek/compare/v1.0.0...HEAD
[unreleased]: https://github.com/Deseteral/ponczek/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/Deseteral/ponczek/releases/tag/v1.0.0...v1.1.0
[1.0.0]: https://github.com/Deseteral/ponczek/releases/tag/v1.0.0
30 changes: 30 additions & 0 deletions examples/src/scenes/imgui-test-scene.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Screen } from 'ponczek/gfx/screen';
import { Scene } from 'ponczek/core/scene';
import { ENDESGA16PaletteIdx } from 'ponczek/palettes/endesga16-palette';
import { Input, SceneManager } from 'ponczek/core';
import { withTransition } from 'examples/utils/with-transition';

export class ImGuiTestScene extends Scene {
private counter: number = 0;

update(): void {
ImGui.Begin('Hello');
ImGui.Text('Hello world from ImGui!');
ImGui.Text(`Counter value: ${this.counter}`);

if (ImGui.Button('Bump value')) {
this.counter += 1;
}

ImGui.End();

if (Input.getButtonDown('b')) withTransition(() => SceneManager.popScene());
}

render(scr: Screen): void {
scr.clearScreen(ENDESGA16PaletteIdx[6]);

scr.color(ENDESGA16PaletteIdx[14]);
scr.fillRect(10, 25, 128, 256);
}
}
2 changes: 2 additions & 0 deletions examples/src/scenes/main-menu-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { SceneStackTestScene } from 'examples/scenes/scene-stack-test-scene';
import { SimplexNoiseTestScene } from 'examples/scenes/simplex-noise-test-scene';
import { TilemapTestScene } from 'examples/scenes/tilemap-test-scene';
import { withTransition } from 'examples/utils/with-transition';
import { ImGuiTestScene } from 'examples/scenes/imgui-test-scene';

interface Item {
text: string,
Expand Down Expand Up @@ -58,6 +59,7 @@ export class MainMenuScene extends Scene {
[{ text: 'Scene stack', scene: () => new SceneStackTestScene() }],
[{ text: 'Simplex noise', scene: () => new SimplexNoiseTestScene() }],
[{ text: 'Tilemap', scene: () => new TilemapTestScene() }],
[{ text: 'ImGui', scene: () => new ImGuiTestScene() }],
];

this.frameTexture = Texture.copy(Assets.texture('frame'));
Expand Down
9 changes: 9 additions & 0 deletions examples/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ body {
canvas {
image-rendering: pixelated;
}

#imgui-canvas {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
}
1 change: 1 addition & 0 deletions imgui-js
Submodule imgui-js added at a66f2a
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ponczek",
"version": "1.0.0",
"version": "1.1.0",
"description": "Deep-fried game framework with sweet filling",
"author": "Deseteral <github.com/deseteral>",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions scripts/generate-index-files.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import fs from 'fs';
import path from 'path';

const ignoredModules = [
'imgui',
];

function writeIndexForFiles(files: string[], indexFilePath: string): void {
const exportList = [
...files.map((fileName) => `export * from './${fileName}';`),
Expand All @@ -14,6 +18,7 @@ const rootFolderContent = fs.readdirSync('./src', { withFileTypes: true });
// Create modules index files
rootFolderContent
.filter((entry) => entry.isDirectory())
.filter((entry) => !ignoredModules.includes(entry.name))
.map((entry) => path.resolve('.', 'src', entry.name))
.forEach((modulePath) => {
const indexFilePath = path.resolve(modulePath, 'index.ts');
Expand All @@ -28,6 +33,7 @@ rootFolderContent
const rootIndexPath = path.resolve('.', 'src', 'index.ts');
const rootModules = rootFolderContent
.filter((entry) => (entry.isDirectory() || path.extname(entry.name) === '.ts'))
.filter((entry) => !ignoredModules.includes(entry.name))
.map((entry) => entry.name)
.map((filePath) => path.basename(filePath, path.extname(filePath)))
.filter((name) => name !== 'index');
Expand Down
2 changes: 2 additions & 0 deletions src/imgui/imgui-env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="./imgui.d.ts" />
import '../../imgui-js/dist/imgui.umd.js'; // eslint-disable-line
Loading

0 comments on commit fe870da

Please sign in to comment.