VDJPedia



 Skin Define

Back to Skin SDK

Skin SDK: The <define> element


Availability: v8.0 onwards

Possibly the biggest time saver ever brought to the SDK. <define> allows you to specify elements once and use that definition throughout the skin without having to re-write it. Any element can be pre-defined and then used later.

The <define> must be at the beginning of the skin in order for it to be seen and used later on.

Parameters: The parameters of the object your are defining; so for a button these could be action and rightclick for example. Additionally:

  • class : the name of the define, for example small_button or songpos
  • classdeck : optionally specify the deck that this class belongs to, allowing for multiple defines with different parameters for different decks that can then be used as a single object

Children: The children of the object you are defining; so for a button these would be the children of that button - for example <up>, <over>, <text>.

Example:

In this example we define a <button> for the left deck. Notice there is no <pos> - you will add this later in the actual element.
<define class="button" classdeck="left">
<size height="45" width="80"/>
<on x="100" y="125"/>
<off x="100" y="170/>
<over x="100" y="215"/>
</define>

With this at the beginning of your skin you can then use the following to position this element. Notice that we only add the <pos> and include class="" in the element header.
<button deck="left" class="button" action="loop_in">
<pos x="356" y="542"/>
<text format="Loop In"/>
</button>

You can also pre-define the text format for the button text:
<define class="button" classdeck="left">
<size height="45" width="80"/>
<on x="100" y="125"/>
<off x="100" y="170/>
<over x="100" y="215"/>
<text align="center" size="15" color="#FFFFFF" weight="bold"/>
</define>

Or a button icon:
<define class="button" classdeck="left">
<size height="45" width="80"/>
<on x="100" y="125"/>
<off x="100" y="170/>
<over x="100" y="215"/>
<icon width="25" height="25" x="1256" y="2154"/>
</define>




Back to Skin SDK