Skip to content

Commit 4b0cda8

Browse files
committed
Greets background: make more things relative to canvas size
1 parent 59b0413 commit 4b0cda8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/greetsBackgroundCanvas.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -168,36 +168,36 @@
168168
var shoutoutNameTextOffsetX = this.canvas.width/4;
169169
var fontSize = 70; // For some long names we want a smaller font
170170
var currentName = '';
171-
if(frame < firstFrameNumber + nameDisplayIntervalFrames){
171+
if(frame < firstFrameNumber + 1 * nameDisplayIntervalFrames){
172172
currentName = 'Darklite';
173-
shoutoutNameTextOffsetX += 64;
173+
shoutoutNameTextOffsetX += this.canvas.width / 5;
174174
}
175175
else if (frame < firstFrameNumber + 2 * nameDisplayIntervalFrames){
176176
currentName = 'Desire';
177-
shoutoutNameTextOffsetX += 16;
177+
shoutoutNameTextOffsetX += this.canvas.width / 7;
178178
}
179179
else if (frame < firstFrameNumber + 3 * nameDisplayIntervalFrames){
180180
currentName = 'Dekadence';
181181
fontSize = 45;
182-
shoutoutNameTextOffsetX += 32;
182+
shoutoutNameTextOffsetX += this.canvas.width / 6;
183183
}
184184
else if (frame < firstFrameNumber + 4 * nameDisplayIntervalFrames){
185185
currentName = 'Ephidrena';
186186
fontSize = 40;
187-
shoutoutNameTextOffsetX += 64;
187+
shoutoutNameTextOffsetX += this.canvas.width / 5;
188188
}
189189
else if (frame < firstFrameNumber + 5 * nameDisplayIntervalFrames){
190190
currentName = 'Mr doob';
191191
fontSize = 50;
192-
shoutoutNameTextOffsetX += 32;
192+
shoutoutNameTextOffsetX += this.canvas.width / 6;
193193
}
194194
else if (frame < firstFrameNumber + 6 * nameDisplayIntervalFrames){
195195
currentName = 'Still';
196196
}
197197
else if (frame < firstFrameNumber + 7 * nameDisplayIntervalFrames){
198198
currentName = 'Solskogen crew';
199199
fontSize = 35;
200-
shoutoutNameTextOffsetX += 64;
200+
shoutoutNameTextOffsetX += this.canvas.width / 5;
201201
}
202202
else {
203203
currentName = 'You!';

0 commit comments

Comments
 (0)