Loading files
5e572f44cThis file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/stack-chan-374381865.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
5e572f44cThis file is pinned to the selected release. Download the original to open it in your design tool.
import { Renderer } from 'dog-face'
import { defaultFaceContext } from 'renderer-base'
import { createBalloonDecorator } from 'decorator'
import Poco from 'commodetto/Poco'
import Timer from 'timer'
import Resource from 'Resource'
import parseBMF from 'commodetto/parseBMF'
import structuredClone from 'structuredClone'
const font = parseBMF(new Resource('NotoSansJP-Regular-24.bf4'))
let poco = new Poco(screen, { rotation: 90, displayListLength: 1024 })
const renderer = new Renderer({ poco })
type Color = [number, number, number]
const black: Color = [0, 0, 0]
const brown: Color = [255, 146, 0]
const balloon = createBalloonDecorator({
bottom: 5,
right: 10,
width: 120,
height: font.height,
font,
text: 'じゅげむじゅげむごこうのすりきれかいじゃりすいぎょのすいぎょうまつふうらいまつ...'
})
renderer.addDecorator(balloon)
const INTERVAL = 1000 / 30
const context = structuredClone(defaultFaceContext)
context.theme.primary = black
context.theme.secondary = brown
let count = 0
Timer.repeat(() => {
count = (count + 30) % 360
context.mouth.open = Math.sin((Math.PI * 2 * count) / 360) / 2 + 0.5
renderer.update(INTERVAL, context)
}, INTERVAL)