Skip to content

Commit

Permalink
Fix for scaling of object
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Apr 26, 2024
1 parent c95b570 commit 1674065
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ function createRulesLawyerEffect(vidFile, data, sfxFile) {
// Constants
const videoWidth = 1104;
const videoHeight = 300;
const windowWidth = window.screen.availWidth;
const desiredWindowScale = 40; //in %
const videoScale = (windowWidth * (desiredWindowScale / 100)) / videoWidth;
const desiredWindowScale = 20; //in %
const videoScale = desiredWindowScale / 100;

// Settings
const position = getSetting("position");
Expand Down Expand Up @@ -101,7 +100,12 @@ function createRulesLawyerEffect(vidFile, data, sfxFile) {
})
.duration(duration)
.fadeOut(fadeOutDuration)
.scale(scale)
.screenSpaceScale({
x: scale,
y: scale,
fitX: true,
ratioY: true,
})
.delay(delay)
.forUsers(data?.chatMessage?.whisper ?? [...game.users.keys()]) // Whisper to specified users or all users
.sound()
Expand Down

0 comments on commit 1674065

Please sign in to comment.