Quantcast
Channel: Learning Appcelerator Titanium » Tutorials
Viewing all articles
Browse latest Browse all 10

How to clear the canvas using Ti.Paint

$
0
0

How to clear the canvas using a shake or orientation change event.

Shake:

Ti.Gesture.addEventListener('shake', function(e){
   painter.clear()
});

Orientation change using a function call:

Ti.Gesture.addEventListener('orientationchange', changed);

function changed() {
    painter.clear()
}

..to remove the event listener:

Ti.Gesture.removeEventListener('orientationchange', changed);

[sources 1 | 2]


Viewing all articles
Browse latest Browse all 10

Trending Articles