Make a desktop pet
that reacts to everything.
Patata gets excited when your cursor comes close, kicks her legs when you pick her up, gets dizzy when you shake her, types when you type and falls asleep when you leave her alone. You build the app. Masko makes the character, all her animations and the state machine that decides which one plays, and the Masko player plays it.
restQuietly Got ThisWhat Masko made
One loop for each reaction and one animation for each move. Hover a clip to play it.
- Restloop
- Ooh, a Cursor!pointerHover
- Wheee, Up We GoheldContact
- Mashed and DizzyheldShake
- Dizzy landinglet go mid-shake
- Droppedlet go
- Keyboard Hurricaneworking
- Hey! Over Here!attention
- Potato Partycelebrate
- Full Potato Panicerror
- Napafter 8 rest loops
How it works
- 1
Make the character and one pose per reaction
Create your pet from a prompt or a picture, then make each pose as an image of the same character: rest, noticed you, dangling, dizzy, typing, calling out, party, panic and nap.
Create a mascot - 2
Connect the poses in a state graph
Each pose is a node with its own loop. Each arrow has the input that triggers it, such as heldContact for a drag. Most ways back to rest are the move played backwards, which is free.
Build a canvas - 3
Let Masko animate it, then play it in a window
Generate all makes every loop and move. Release the canvas and play it with the Masko player in a transparent window that floats above other apps.
Play a canvas
Some moves on Patata’s canvas
{
"edges": [
{ "id": "idle-to-dangling",
"conditionGroups": [
[{ "input": "behavior::heldContact", "op": "==", "value": true }],
[{ "input": "behavior::heldShake", "op": "==", "value": true }]
] },
{ "id": "dangling-to-mashed-and-dizzy",
"conditions": [{ "input": "behavior::heldShake", "op": "==", "value": true }] },
{ "id": "idle-to-typing-frenzy",
"conditions": [{ "input": "behavior::working", "op": "==", "value": true }] },
{ "id": "typing-frenzy-to-idle", "reverse": true,
"conditions": [{ "input": "behavior::working", "op": "==", "value": false }] },
{ "id": "idle-to-nap-time",
"conditions": [{ "input": "node::loopCount", "op": ">=", "value": 8 }] }
]
}The pet window, in Electron
// main.js: a frameless, transparent window above other apps
const { app, BrowserWindow } = require('electron');
app.whenReady().then(() => {
const pet = new BrowserWindow({
width: 240,
height: 240,
transparent: true,
frame: false,
hasShadow: false,
resizable: false,
alwaysOnTop: true
});
pet.loadFile('pet.html'); // mounts the Masko player with the release
});Questions
What plays it?
The Masko player, open source, on the web, in Electron and in iPhone, iPad, Mac, Android, React Native and Flutter apps. It plays the canvas release, picks the transparent file each platform shows and goes from pose to pose without a flicker. Your app only tells it what is happening.
How does the pet float above my other windows?
In Electron, use a frameless transparent BrowserWindow with alwaysOnTop, as in the code above, and mount the Masko player in it: the player has an Electron example. In a Swift app, use a borderless NSWindow with a clear background at the floating level, with a MaskoPlayerView inside.
How does she move around the screen?
Move the window, not the video. While the pet is held, send the pointer position to the main process and move the window there. On release, drop it to the bottom of the screen while the landing clip plays.
Can my desktop pet talk?
Yes. Give the mascot a voice, then make a talking clip from a line of text: the mouth moves with the words and the clip comes with its sound. Play it when your app has something to say.
How much did Patata cost?
$51.38: $1.38 for the poses, including two redraws, and $50.00 for twenty animations, including one redo. The seven ways back are moves played backwards, so they are free.
Does it work on Windows?
Yes, as an Electron app, where the Masko player plays the WebM clips on Mac and Windows. A native Mac app uses the Masko player for Swift.
