Skip to content

Commit

Permalink
Bump version to 0.8.10 and update TickerBase to improve type argument…
Browse files Browse the repository at this point in the history
… handling
  • Loading branch information
BlackRam-oss committed Nov 22, 2024
1 parent 031682c commit ed26096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drincs/pixi-vn",
"version": "0.8.9",
"version": "0.8.10",
"type": "module",
"description": "Pixi'VN is a npm package that provides various features for creating visual novels.",
"main": "./dist/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ticker/TickerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { TickerIdType } from "../../types/TickerIdType"
* }
* ```
*/
export default class TickerBase<TArgs extends TickerArgs | {}> implements Ticker<TArgs> {
export default class TickerBase<TArgs extends (TickerArgs | {})> implements Ticker<TArgs> {
/**
* @param args The arguments that you want to pass to the ticker.
* @param duration The duration of the ticker in seconds. If is undefined, the step will end only when the animation is finished (if the animation doesn't have a goal to reach then it won't finish). @default undefined
Expand Down
12 changes: 7 additions & 5 deletions src/labels/CustomTickerCanvasElementTestLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class AlienTintingTest extends CanvasSprite<IAlienTintingMemory> {
}
}

interface TintingTestTickerArgs {
test?: string
}

@tickerDecorator("___pixi_vn_custom_ticker___")
export class TintingTestTicker extends TickerBase<{}> {
constructor() {
super({})
}
export class TintingTestTicker extends TickerBase<TintingTestTickerArgs> {
override fn(_t: TickerValue, _args: {}, aliases: string[]): void {
aliases.forEach((alias) => {
// create a bounding box for the little dudes
Expand Down Expand Up @@ -118,7 +119,8 @@ export const customTickerCanvasElementTestLabel = newLabel(CUSTOM_TICKER_CANVAS_
dude.speed = 2 + Math.random() * 2;

canvas.add("alien" + i, dude);
canvas.addTicker("alien" + i, new TintingTestTicker());
let args: TintingTestTickerArgs = {}
canvas.addTicker("alien" + i, new TintingTestTicker(args));
}
narration.dialogue = {
character: juliette,
Expand Down

0 comments on commit ed26096

Please sign in to comment.