javascript_terminal
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
javascript_terminal [2023/11/20 14:53] – appledog | javascript_terminal [2023/11/24 01:34] (current) – appledog | ||
---|---|---|---|
Line 1: | Line 1: | ||
= JavaScript Terminal | = JavaScript Terminal | ||
+ | * Also see: [[JavaScript Terminal v2|Version 2]] which is a more advanced version of this codebase. | ||
+ | |||
This section will outline the basic JavaScript terminal code. This code was not used much when I taught JavaScript to Roger and Neo, but it serves the same basic purpose as the [[PyGame Terminal]]. | This section will outline the basic JavaScript terminal code. This code was not used much when I taught JavaScript to Roger and Neo, but it serves the same basic purpose as the [[PyGame Terminal]]. | ||
Line 339: | Line 341: | ||
However, one interesting quirk which arose is that the ctx.font has to be set upon terminal resize. I am not sure where the best place is to set it, but it seems to work great setting it on a resize. It would also work if you set it every time you drew a character, but if we assume that we are only using one font and are essentially the main application (a one-canvas app) then setting it on every character draw is probably unnecessary. | However, one interesting quirk which arose is that the ctx.font has to be set upon terminal resize. I am not sure where the best place is to set it, but it seems to work great setting it on a resize. It would also work if you set it every time you drew a character, but if we assume that we are only using one font and are essentially the main application (a one-canvas app) then setting it on every character draw is probably unnecessary. | ||
+ | |||
+ | == Also See | ||
+ | * Also see: [[JavaScript Terminal v2|Version 2]] which is a more advanced version of this codebase. | ||
+ | |||
javascript_terminal.1700492013.txt.gz · Last modified: 2023/11/20 14:53 by appledog