Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.
Stay Down Dev Log - Part 10 - Fit Canvas To Window
3 years ago
19
frank poth
html5
js
css
javascript
html5 game
programming tutorial
pothonprogramming
learn programming
programming
code
Hey, everybody! If you are looking for a tutorial on how to make your game's display canvas scale to fit the window without breaking its aspect ratio you have come to the right place. In addition to lots of code refactoring I'll be adding this functionality to my 2D game project. I'm using HTML5 and JS, but you could use the same logic in any application to make one rectangle scale to fit inside another.
What you'll see in this video:
00:00:45 - Refactoring the global object
00:03:45 - Refactoring the Game States
00:19:00 - Resizing the display canvas
00:24:00 - Testing it out
Thanks for watching! Check out the site! https://pothonprogramming.github.io
Loading comments...
-
17:39
Poth On Programming
3 years agoStay Down Dev Log - Part 9 - Destructuring Objects
20 -
56:52
Poth On Programming
3 years agoStay Down Dev Log - Part 14 - Background Graphics!
20 -
50:45
Poth On Programming
3 years agoStay Down Dev Log - Part 15 - Custom Text Graphics
44 -
47:58
Poth On Programming
3 years agoStay Down Dev Log - Part 1 - Gravity, Friction, Hit The Ground!
77 -
0:26
Colinborg96
3 years agoSealing window part 1
62 -
1:59
307 Gaming
3 years agoWindow Beat Down
5 -
29:04
Poth On Programming
3 years agoStay Down Dev Log - Part 2 - Keyboard Controls, Running and Jumping!
42 -
8:15
Pixel
3 years ago $0.01 earnedSpace Game Part 33 - Character Window!
62 -
0:17
ViralHog
6 years agoMuffler Tied Down Through Car Window
401 -
3:41
KMTV
4 years agoTearing down the old broken window syndrome
19