Skip to main content

December update: Stencils

· 4 min read
raysplaceinspace
Creator of Easel
info

Easel is a beginner-friendly programming language for online games. Intrigued? Visit our home page to learn more.

Stencils are here! Keep reading to learn about this and other new features in Easel.

Stencils

Stencils are a new feature that let you limit the rendering of a camera to a specific shape.

You'll be able to use stencils to create a variety of cool effects in your games, such as:

  • Scene transitions: Create cool scene transitions by animating a stencil shape that reveals or hides the scene.
  • Fog of war: Limit a player to only seeing what their units can see, by stenciling the camera around each unit. Stencils are additive, so overlapping stencils combine to reveal more area.
  • Stylized borders: Give your minimap a fancy shape by giving its camera a stencil.
  • Search and reveal: Create a spotlight effect by using a circular stencil that follows the mouse pointer

See the Stencils documentation to learn more.

TextSprites

Displaying text in your games just got a lot more powerful! TextSprite has a few new parameters:

  • bold and italic let you style your text even more.
  • fontSize lets you set the size of your text in em units. Use this instead of the radius property if you want your text to match other UI elements. You should use fontSize over the old heightPx parameter where possible, as pixel units do not respect the user's choice of text size, while em units do. Users may have a larger text size than you expect, perhaps because they have low vision or are using a small screen, and using em units helps ensure your text is readable for everyone.
  • align lets you center, left, right align your text.
  • vAlign lets you vertically align your text to the top, center, or bottom of its position. The old anchorTop and anchorBottom parameters have been deprecated in favor of this new parameter.

This required reworking some of the text rendering system, and now it is more efficient! The text is now rendered onto a bounding box that is only just as big as it needs to be, reducing unnecessary computation and improving performance.

Physics engine upgrade

Physics is a great way to make your games deeper, because people intuitively understand the complexity of physical interactions without you needing to explain it to them.

The physics engine has been upgraded to a newer version of Rapier, which should improve performance. Rapier reports an improvement of 25% on various benchmarks. This means you can make even bigger games with Easel!

As part of this, now when new colliders are added, they will automatically show up in any spatial queries like QueryNearest, whereas previously you would need to call ResetSpatialQueryIndex or wait for the next physics step to have them includd. You still need to call ResetSpatialQueryIndex if you move existing colliders around and want that to be reflected in your query. And even then, you may want to consider just waiting until the next frame when the physics engine automatically updates the spatial query index.

Rollback netcode

Easel lets you code multiplayer games like everyone is in one shared world, like a singleplayer game. Powering this magic is an approach called rollback netcode that lets players see immediate responses to their inputs, even before those inputs have reached other players. We now have a dedicated page that describes exactly what is special about Easel's rollback netcode implementation. Check it out to learn more about how it works under the hood!