recipeToon.scene
- .build.state16 B
- .metadata17 B
- README.md8.3 KB
- build.luau991 B
- entrypoint.luau145 B
- scene.json125 KB
This package holds more than this page lists. See all of its files in its world.
README.md
Toon (Style Cookbook recipe scene)
toonBlocks' Comic ink cel look: the light on every surface cut into three hard bands with cool lavender shadows, a thin rim of light on silhouettes, hard highlights on rounded things, flat cel colour, and an even dark ink line drawn round every object as an inverted hull, the same width near and far and on the animated character. One call: StyleKit.applyLook("comicInkCel"). The stack is the look's own entries: toonBands (light), toonRim (rim), toonHighlight (shine), celFill (fill) and toonOutline (line), all five shipped in toonBlocks.
One change each:
- Ramp light instead of bands:
StyleKit.swap("light", "toonRamp"), then pick a ramp:ToonBlocks.setRamp("sunset")(ormoonlight,candy,noir,pastelAnimeand eight more,ToonBlocks.ramps()lists them). - Soft wrap-around light:
StyleKit.swap("light", "toonWrap"). - Another line:
StyleKit.swap("line", "toonSticker")(thick white border),"toonTintLine"(tinted from each object's colour),"depthLine"(styleKit's depth line) or"inkPenLine"(inkBlocks' pen). - Another whole toon look:
StyleKit.applyLook("saturdayMorning"),"softAnime","clearLine","thickSticker","ninetiesCG"or"pencilAnime". - The look on brown kraft paper:
StyleKit.add("paperKraft", { id = "paper" })(needs paperBlocks).
The scene is the Lookbook's campaign stage (lookbookShowcaseKit) with its lights, sky and the normal player setup, the recipe's style stack on a synced StyleStack so every player sees the same look and the same outline widths, and beside the stage the reference picture the recipe was tuned against (design/references/toonstage/stage_toon_cel) on a board (left out of the stack, so it shows as drawn) with the recipe's blocks and the calls that change them. The RecipeView camera stands where the reference was drawn from. The stage's sun stands low behind the house, so the walls this camera sees are in the shadow band where the picture has them sunlit. Since toonBlocks 1.0.4 the shadow band keeps each surface's own colour (keepShade), so the brick walls and the tile roof stay brick red and tile red with a cool cast, a step darker than the sunlit walls of the reference rather than the dark brown they were. The scene opens wearing the look: its saved StyleStack holds the five entries above, and a player or agent clearing the stack while the scene is open changes the live scene only until it is saved. Built by scenes.RecipeStage; load it with zero scene load scenes.recipeToon.
What takes the place of motion blur and depth of field
A cel look is made of hard edges: flat areas of colour, band edges and an ink line. Camera blur turns all three into grey gradients, so this look keeps every frame sharp and carries motion and depth with shapes instead.
- Leave the camera's
MotionBlurandDepthOfFieldcomponents off (they are opt-in components on a camera; remove them from a game's player camera before applying a toon look). Blur smears the outline ink into the fill, and a soft background behind a hard foreground line reads as a mistake, not as focus. - Speed is drawn, not blurred. Show fast motion in the animation and effects: a stretched smear pose for a frame or two, speed lines or streak particles behind the mover, a dust puff on landing, a hard impact frame. The outline stays crisp at any speed because each line is real geometry wrapped round its object; it never trails.
- Depth comes from line weight and value.
StyleKit.swap("line", "toonFarLine")keeps near lines bold and thins far ones down to a fine 0.7 px line (from 6 to 60 metres), the way a background painter draws the distance lighter. Keep the scene's own fog and haze: the toon blocks read fog as light, so far planes still lighten. Keep the focus by staging, with the hero in the strongest light and the thickest line, and the background in the middle tones.
UI and type with this look
- Draw the UI with the same rules as the world: flat colour panels, a dark ink border of about the outline's weight (2 to 3 px at 1080p, the world's
toonOutlineis 2.2 here), no gradients, glows or soft drop shadows. A shadow is a hard offset shape in the ink colour. - Type: a heavy rounded sans or a hand-lettered display face for titles and big numbers, a plain bold sans for body text, never thinner than about 18 px at 1080p. Give text a solid backing panel or an ink outline so it reads over busy band edges.
- Colour from the light: pick UI colours from the ramp the world uses (
ToonBlocks.ramp("sunset").colours): a mid stop for panels, the high stop for text, one saturated accent. Then the HUD changes mood with the world when you switch ramps. - Keep it out of the stack. Screen UI is drawn after the style stack and is never toon-shaded. World-space labels, nameplates and health bars should be left out by name (
StyleKit.options({ exclude = { "Nameplate" } })) and given no hull (ToonBlocks.setObjectOutline(label, false)). The health bar over the mannequin in this recipe stays as drawn. - UI motion should pop and settle: scale to 110 % and back over about 0.15 s, slide in fast and hold. Avoid slow cross-fades.
Animation timing
- Strong poses and holds. Cel animation reads in poses: a quick anticipation, a short fast travel, an overshoot, then a held pose. Ease hard in and out. Avoid the even, floaty in-betweens that suit realistic rendering, because flat shading hides the subtle motion that would make them read.
- The look itself never steps. The toon blocks redraw every frame and keep no held clock (unlike inkBlocks' boil or watercolor edges), so the camera, the light and the outlines move on every frame. Keep camera moves smooth and on ones.
- Characters on twos are authored, not switched. For the hand-drawn feel of 12 poses a second, key the clips with stepped (constant) interpolation on every second frame. The engine has no switch that holds skinned poses for you (
renderer.setSkinningPoseHoldis a cost cache, not stepped timing). Mixing the two is classic: characters on twos, camera and effects on ones. - Light can perform. A sun or lamp that moves slowly sweeps band edges across surfaces the way cel animation does. A sudden flash pops whole surfaces from the shadow band to the lit band, which works for hits and lightning.
A new combination: comic print
Toon light under starterBlocks' halftone dots, which nobody has listed with toonBlocks before: two hard light bands, flat cel colour, a dot screen printed only into the shadow band, and the ink outline. The result reads like a printed comic page. starterBlocks comes with every toonBlocks install.
StyleKit.load({
{ id = "light", block = "toonBands", settings = { bands = 2, shadowLift = 0.7 } },
{ id = "fill", block = "celFill", settings = { keepLight = 1, saturation = 1.2 } },
{ id = "dots", block = "surfaceDots", settings = { threshold = 0.62, amount = 0.55, maxCover = 0.45, dotsPerMetre = 6 } },
{ id = "line", block = "toonOutline", settings = { width = 2.4 } },
})

The picture is design/references/toonstage/combos/toon_comic_print.png, taken on this stage from the RecipeView camera. The dots go into the shaded walls, the roof, the basin and the crate sides, and the sunlit paving stays clean. threshold decides which band takes dots: at 0.45 the whole picture prints like a screen door, at 0.8 only the deepest darks take dots, and about 0.62 matches the shadow band of two toon bands here. The dots sit on surfaces (they are laid on world position), so they stay on still things when the camera pans and slide over moving characters, as every full-frame mark does. For a flat colour print without bands, swap light out; for newsprint paper under it, add paperBlocks' paperNewsprint.
Known limits
- The look runs after antialiasing, so offscreen captures do not show it; read the presented frame (#17427).
- A two-client editor sometimes refuses to load two different scenes at once (#24666, #24667).
- A world boot can wait about 30 s on a network handshake before any content starts (#24669).
- The web build was not checked from here (#20946).