RBX Pen Showcase
This past week after seeing a post about the game Draw Me and trying it out, I got hit by the intrusive thought, “What if I could forward pen pressure to Roblox?” And as far as I’m aware? I think I’m the first to ever do it.
This project serves a couple of purposes besides being fun to work on:
- A showcase of how currently pen pressure data can be forwarded to Roblox
- An example of what Roblox could unlock for developers if pen pressure data was available
- A case for why the current EditableImage limit should be increased
- To be a free resource for learning about graphics and/or be referenced or used by others
This project consists of two parts: First is the OpenTabletDriver plugin written in C# which takes on the role of forwarding pen pressure data as a virtual/emulated controller (created and managed via ViGemBus), mapping the pressure data to trigger actuation. Note that this requires additional drivers to be installed, which means there is high friction on the player’s side to take advantage of this, along with the risk of faulty driver installation. This project serves only as an example of what could be done with pen pressure.
The second part is the painting software that actually makes use of this pressure data, which uses a combination of OSGL and some of my own graphics manipulation to present a relatively usable painting solution on Roblox.
The game can be tried here, whereas the code is freely available at GitHub - PhantomShift/rbx-pen-showcase: A showcase of tablet pen pressure in Roblox through an emulated controller. Hopefully this can serve as a relatively simple reference/example of how other developers could potentially take advantage of pen pressure data, assuming Roblox ever chooses to expose it. Secondarily, I hope to expand the scope of the painting software itself to serve as an interesting technical demonstration of what you can build on Roblox.
One major caveat as of writing, only 4 layers are allowed on the game client (999 layers in studio) due to the limits imposed on EditableImage. I do have a plan for working around this detailed in the README of the project, but currently this heavily limits potential workflows in-game.
Shortcuts
As of writing I do not currently have shortcuts written visibly anywhere in the place, so for now they are listed here.
| Action | Shortcut | Description |
|---|---|---|
| Toggle Eraser | E | Switches between brush and eraser (eraser is just a brush that puts full transparency). |
| Zoom Canvas | LeftCtrl + Space + Drag | Zooms into the canvas when dragging right, zooms out when dragging left. |
| Pan Canvas | Space + Drag | Pans canvas based on cursor movement. |
| Change Brush Size | LeftShift + Drag | Increases brush size when dragging right, decreases when dragging left. |
| Eyedropper | LeftCtrl + Drag | Selects the color of the pixel currently under the cursor. Evaluates all layers. |
| Undo | LeftCtrl + Z | Pops the most recent action pushed to the undo stack. Pushes to redo stack. |
| Redo | LeftCtrl + Y | Pops the most recent action pushed to the redo stack. Pushes to the undo stack. The redo stack is cleared if another action occurs. |
Currently the undo stack has a strict limit of 128 actions and the overall history a limit of 512MB, which is consumed depending on the nature of the action (i.e. low usage for moving layers, high usage for a stroke with a large bounding box). Actions that cause the stack to go beyond these limits cause the bottom of the stack to be freed and forgotten.
Media
Below are a couple of example illustrations that I’ve made using this project so far.
Very open to feedback and suggestions, especially for some future more computationally expensive/complex operations like layer compositing in order to overcome EditableImage memory limits while maintaining usable performance. I’d also love to learn about other ways you could potentially forward pen pressure data, especially if it’s simpler/less intrusive than what I’ve currently shown! Of course, I’m also open to direct contributions.

