Skip to content

Commit

Permalink
Merge pull request #253 from jeffreykirchner/dev
Browse files Browse the repository at this point in the history
add barrier scaling
  • Loading branch information
jeffreykirchner authored Nov 17, 2023
2 parents ae5f8ef + 521e5d8 commit 300faa5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main/templates/subject/subject_home/the_stage/barriers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ setup_pixi_barrier()
//outline
let outline = new PIXI.Graphics();
//outline.lineStyle(1, 0x000000);
scale = 100 / app.pixi_textures.barrier_tex.width;
let matrix = new PIXI.Matrix(1,0,0,1,0,0);

let scale_y = 1;
if(rotation == 0)
{
scale_y = barrier.height / app.pixi_textures.barrier_tex.height;
}
else
{
scale_y = barrier.width / app.pixi_textures.barrier_tex.height;
}
matrix.scale(1,scale_y);

matrix.rotate(rotation);

outline.beginTextureFill({texture: app.pixi_textures['barrier_tex'], matrix:matrix}); //,
outline.drawRect(0, 0, barrier.width, barrier.height);

Expand Down

0 comments on commit 300faa5

Please sign in to comment.