Skip to content

Commit

Permalink
2.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed May 7, 2023
1 parent 1b1c45c commit e258e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.11

- (Refinement) Adjust starting angle of Token Effects HUD icons.

# 2.1.10

- (Refinement) Add anti-aliasing to Token Effects HUD icons, courtesy of @Wasp.
Expand Down
12 changes: 4 additions & 8 deletions modules/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,12 @@ Hooks.once("init", () => {
let tex = await loadTexture(src, { fallback: "icons/svg/hazard.svg" });
let icon = new PIXI.Sprite(tex);
if (src != game.settings.get("pf2e", "deathIcon")) {

// If the circular mask hasn't been created yet
if(!circularMaskTexture){
if (!circularMaskTexture) {
// Define a new render texture that is 110x110
circularMaskTexture = PIXI.RenderTexture.create(110, 110);
// Define the mask sprite
const renderedMaskSprite = new PIXI.Graphics()
.beginFill(0xffffff)
.drawCircle(55, 55, 55)
.endFill();
const renderedMaskSprite = new PIXI.Graphics().beginFill(0xffffff).drawCircle(55, 55, 55).endFill();
// Blur the mask sprite
const blurFilter = new PIXI.filters.BlurFilter(2);
renderedMaskSprite.filters = [blurFilter];
Expand Down Expand Up @@ -192,8 +188,8 @@ Hooks.once("init", () => {
const tokenTileFactor = token?.document?.width ?? 1;
const sizeOffset = sizeToOffset(actorSize);
const offset = sizeOffset * tokenTileFactor * gridSize;
const quarterRotation = 0.5 * Math.PI;
const { x, y } = polar_to_cartesian(offset, (ratio + 0) * 2 * Math.PI + quarterRotation);
const initialRotation = (0.5 + (1 / max) * Math.PI) * Math.PI;
const { x, y } = polar_to_cartesian(offset, (ratio + 0) * 2 * Math.PI + initialRotation);
// debugger;
effectIcon.position.x = x / 2 + (gridSize * tokenTileFactor) / 2;
effectIcon.position.y = (-1 * y) / 2 + (gridSize * tokenTileFactor) / 2;
Expand Down

0 comments on commit e258e08

Please sign in to comment.