Modern Skin: Snap Points

From Winamp Developer Wiki

Jump to: navigation, search

Creating a Modern Skin --> Intro --> Winamp 2 to Winamp 3+ --> Simple Skin Tutorial --> XML Intro --> Simple Skin Tutorial (Continued) --> Container --> Group --> Relative Positioning --> Complex Skin --> Non-Rect Player --> Layer Composition --> Alpha Channels --> Animatedlayer --> Snap Points --> Drawers --> Skin Scripting --> Drawer Scripting --> Animating a Skin --> Maki Overview --> Glossary


A snap point is a point that windows will snap on to. When you move that window close in proximity to that point, the window will "latch" on to that point. You can drag it out of that point later. Take a look at these two examples.

Boxor Example

Snap point is a useful tool that adds more functionalities to your skin. Take a look at the Boxor example.


Image:Snappoint boxor.png



Default Player Example

Image:Snappoint default.png

* Snap points defined along the Main Window


Image:Winamp3 mainpl.png

* The Playlist Editor snaps to the Main Window when you move it close in proximity of the Main Window



XML Example

Lets take a look at the XML code to define a snappoint. To get two components to snap together when they're close, you need to define snappoints in their XML. The XML itself is simple. The important part is the id: components with the same snappoint id will snap together whereas components with different ids will not.


Image:Snappoint xml1.png


Image:Snappoint xml2.png

Personal tools
Winamp
AOL Developer Network

Download Winamp, The #1 Free Media Player. Play your MP3, AAC, MPEG, AVI files, and more. Get free MP3 songs, videos, skins and plug-ins. Sync your iPod or Creative Zen, and get mobile music with Winamp Remote.

Copyright © 1999 - 2009 Nullsoft. All Rights Reserved.