On this page, you'll find small MT4j source code snippets which demonstrate how to achieve various goals. It may also help to get a feel on how to use the facilities of MT4j to create custom behaviour yourself. If you have useful or interesting code snippets, let us know so everybody can benefit from it!


Create a scrollable text area using MTList

We can use the MTList's scrolling feature to easily create a scrollable text area.

Use direct OpenGL calls to draw our components

This little snippet demonstrates how we can access the opengl context directly and use it to draw our components.

Limit dragging of a child shape to the shape of the parent

If we want to limit dragging of a (2D) shape to the boundaries of the parent's shape we can use this method to achieve our goal.

Use the scale gesture to seek in a MTMovieClip

Using this little trick we can seek in a video using the 2 finger scale gesture.

Powered by MediaWiki contact