Skip to content

Commit

Permalink
Proof-of-concept torchlight effect
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Jan 9, 2025
1 parent f224b79 commit f3f7b05
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Binary file added data/maps/effect/torchlight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/maps/effect/torchlight.xcf.bz2
Binary file not shown.
4 changes: 4 additions & 0 deletions doc/sources/graphics-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ data/maps/parallax/

stars Jordan Irwin (AntumDeluge); CC0; Stendhal

data/maps/effect/

torchlight Jordan Irwin (AntumDeluge); CC0; Stendhal

data/sprites/

baby_dragon.png Kimmo Rundelin (kiheru); CC BY-SA 3.0; Stendhal
Expand Down
7 changes: 7 additions & 0 deletions src/js/stendhal/ui/ViewPort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export class ViewPort {
/** Styles to be applied when chat panel is not floating. */
private readonly initialStyle: {[prop: string]: string};

private torchlight? = stendhal.data.sprites.get(stendhal.paths.maps + "/effect/torchlight.png");

/** Singleton instance. */
private static instance: ViewPort;

Expand Down Expand Up @@ -152,6 +154,11 @@ export class ViewPort {
this.applyHSLFilter();
this.drawEntitiesTop();
this.drawEmojiSprites();

if (this.torchlight && this.torchlight.height) {
this.ctx.drawImage(this.torchlight, this.offsetX, this.offsetY);
}

this.drawTextSprites();
this.drawTextSprites(this.notifSprites);

Expand Down

0 comments on commit f3f7b05

Please sign in to comment.