Get Tablet Pressure & Gestures into Flash via Bamboo Dock
Multi-touch, gestures and pressure are becoming the standard input mechanism for the average user and creatives alike. But for creative tools, pen pressure is often more of a necessity. And as far as I know, Wacom tablets are the only device capable of providing this data. So to get the ball rolling, I worked with Wacom to add pressure support to Livebrush. (Actually, they were invaluable. I couldn't have done it without their support.)
The most exciting part of including pressure is how it can be combined with velocity. You can have the precision of pressure while drawing, and then simply release the brush to have it use your gesture to elegantly complete the line. Here's a quick video demo.All the details, code and sample files are below.
Primer
Using Wacom tablets, pressure and gesture events are passed into Flash via their Bamboo Dock (download & install). Then, using their extensions you can test your apps within your Flash/Flash Builder workflow. Once installed, the Bamboo Dock automatically launches when you're testing SWF's within Flash or running/testing AIR applications. So, if you haven't already, download the Bamboo Dock and extension.
TabletEvents.FLA
This example shows how to initialize the tablet connection and register for events. The interface traces the events on screen. Download
Tablet class
I've simplified the tablet connection with a custom Tablet.as class. It abstracts as much of the tablet implementation as possible. It's also the same class I use in Livebrush (so it may be a little rough around the edges). Simply call Tablet.init(this) to initialize the tablet connection and associate it to the main stage. Then listen for TabletEvent's and TabletGestureEvent's on any display object. You could also create your own implementation using the classes provided by Wacom.
Play with pressure
Click here to download Livebrush with pressure. Or if you already have the Bamboo Dock installed, you can install Livebrush as a Mini!
Additional Links
The most exciting part of including pressure is how it can be combined with velocity. You can have the precision of pressure while drawing, and then simply release the brush to have it use your gesture to elegantly complete the line. Here's a quick video demo.All the details, code and sample files are below.
Primer
Using Wacom tablets, pressure and gesture events are passed into Flash via their Bamboo Dock (download & install). Then, using their extensions you can test your apps within your Flash/Flash Builder workflow. Once installed, the Bamboo Dock automatically launches when you're testing SWF's within Flash or running/testing AIR applications. So, if you haven't already, download the Bamboo Dock and extension.
TabletEvents.FLA
This example shows how to initialize the tablet connection and register for events. The interface traces the events on screen. Download
ImageViewer.FLA
This example uses the same gesture events from the previous example to manipulate an image. Download
Tablet class
I've simplified the tablet connection with a custom Tablet.as class. It abstracts as much of the tablet implementation as possible. It's also the same class I use in Livebrush (so it may be a little rough around the edges). Simply call Tablet.init(this) to initialize the tablet connection and associate it to the main stage. Then listen for TabletEvent's and TabletGestureEvent's on any display object. You could also create your own implementation using the classes provided by Wacom.
Play with pressure
Click here to download Livebrush with pressure. Or if you already have the Bamboo Dock installed, you can install Livebrush as a Mini!
Additional Links
13 Comments:
That might be the wrong place to add this question, but I installed bamboo dock and livebrush Pro and preferences pane shows that pressure is enabled BUT it doesn't work when I link pressure to width or opacity.
Do I need to install an extension of some sort if I'm using it to draw and NOT develop anything?
By the way, wonderful app, I'm thrilled to work with it a bit more.
Thanks for your feedback :)
I haven't seen this issue, where the prefs indicate pressure is enabled, but the settings don't work. Have you tried increasing the max width for the associated properties?
Hi, nice work ! Can you give me a hint how to get this to work in a Flex-Air-App ? Would be very nice if i could add eventlisteners for Bamboo-Gesture-Events in such a simple way like you do it in the fla's. Thanks, drypnik
Hi David, nice work!
I am currently trying to use that library to a little flash project i have created in order to implement a little brush that doesn't exist in photoshop (implementating it as a photoshop plugin is too much work) but i am unable to make the import.**** correctly, i always end-up with errors and i can't find any help in the documentation on how imports are managed in flash. Could you post a step by step explanation please?
Hey David - thanks so much for putting this together! It all works great until I package my project as an AIR file, and then the gestures stop working. I was hoping you had found a way around that, am I mistaken?
Without more specifics I can't be sure what issues you're having. Can you post the compiler errors?
@momo_the_monster,
I haven't encountered this issue. If you have the bamboo dock installed, running an AIR app that has correctly initiated Wacom's tablet connection, the dock should automatically load. Is this the case in your situation?
hi david, great work, was checking out your code in flex. but i came across a problem.. when i use Tablet.init(this).. it gives me an error.. Implicit coercion of a value of type SketchBoard to an unrelated type flash.display:MovieClip. .. any help will be greatly appreciated..
I bought Livebrush pro, but I have not received the download link,
Does anyone could help me?
Hi David,
I've bought the pro version, but, I wish if I could add this feature to it.
What I could do to get it on??
This comment has been removed by the author.
I am a new guy to visit your blog and all the pharmaceutical and packing machines and Tablet Presser products comes with high quality and unique in feature.More information websites Tablet Presser our sites.
Buy Tablet Presser, Pill Press, Tablet Machine, Tablet Presser, Pill Presser, best pharmaceutical and packing machines from Chinese Wholesalers on medpacking.com
Post a Comment
Subscribe to Post Comments [Atom]
<< Home