Quick Sign In:  

Forum: VirtualDJ Skins

Topic: Sampler Buttons with coloured borders

This topic is old and might contain outdated or incorrect information.

djkrysrPRO InfinityMember since 2010
Hi
I have tried modifying the default skin to have a group of sample buttons where the border of each button is the sample color but I can't get it to work. I have modified the basic padbutton as that seemed easiest.
This is what I have done...

In the define section...
<define class="sampler_button" placeholders="action,rightclick,important=true,textaction,sourcecolor,textsize=13">
<button action="[ACTION]" rightclick="[RIGHTCLICK]">
<size width="63" height="30"/>
<off color="buttonoff" shape="square" border="[SOURCECOLOR]" border_size="2" radius="2"/>
<over color="buttonover" shape="square" border="[SOURCECOLOR]" border_size="2" radius="2"/>
<selected color="padbuttonselected" shape="square" border="buttonon" border="[SOURCECOLOR]" border_size="2" radius="2"/>
<down color="buttonon" shape="square" border="[SOURCECOLOR]" border_size="1" radius="2"/>
<text dx="+4" dy="-3" width="54" fontsize="[TEXTSIZE]" color="textoff2" colorover="textover" weight="bold" colorselected="textselected" colordown="texton" align="center" action="[TEXTACTION]" important="[IMPORTANT]"/>
</button>
</define>

Then in the main skin...
<group name="pads" x="+0" y="+100-30-7-6-26" >
<panel class="sampler_button" action="sampler_play_stop 1" textaction="get_sample_name 1" sourcecolor="sampler_color 1"/>
<panel class="sampler_button" x="+69" y="+0" action="sampler_play_stop 2" textaction="get_sample_name 2" sourcecolor="sampler_color 2"/>
<panel class="sampler_button" x="+69+69" y="+0" action="sampler_play_stop 3" textaction="get_sample_name 3" sourcecolor="sampler_color 3"/>
<panel class="sampler_button" x="+69+69+69" y="+0" action="sampler_play_stop 4" textaction="get_sample_name 4" sourcecolor="sampler_color 4"/>
<panel class="sampler_button" x="+0" y="+36" action="sampler_play_stop 5" textaction="get_sample_name 5" sourcecolor="sampler_color 5"/>
<panel class="sampler_button" x="+69" y="+36" action="sampler_play_stop 6" textaction="get_sample_name 6" sourcecolor="sampler_color 6"/>
<panel class="sampler_button" x="+69+69" y="+36" action="sampler_play_stop 7" textaction="get_sample_name 7" sourcecolor="sampler_color 7"/>
<panel class="sampler_button" x="+69+69+69" y="+36" action="sampler_play_stop 8" textaction="get_sample_name 8" sourcecolor="sampler_color 8"/>
</group>

It doesn't work though, can anyone see why?
If I change [TEXTACTION] to [SOURCECOLOR] in the define section, the button text displays the color of the sample as expected ("yellow", "white" etc) but the borders themselves are invisible. If i change [SOURCECOLOR] to be "yellow" the border is yellow and visible so the actual syntax is correct. What am I missing.

Any help would be appreciated.
 

Posted Sat 14 Dec 19 @ 7:40 pm
NicotuxHome userMember since 2014
1- you have a bug that define twice the color :
border="buttonon" border="[SOURCECOLOR]"
the first one is taken

2- You are trying to use placeholders a way they do not work :/ yet ?
placeholders only replace plain text expressions. they do not evaluate

the evaluation - if any needed - will be done at use time, only if the location allows it

in your script you use in example 'sourcecolor="sampler_color 1"'

when used in ' border="[SOURCECOLOR]"' this will expand to ' border="sampler_color 1"' but border does not allow to use script in its value
when you change [TEXTACTION] to [SOURCECOLOR] in the define section, the button text displays the color of the sample as expected because 'action' is executing the script

the same way, if you replace 'action="[TEXTACTION]"' with 'text="[TEXTACTION]"' you will see the command, not the result

3 - Possible Workaround : add an underlay and make border of button transparent

<define class="sampler_button" placeholders="action,rightclick,important=true,textaction,sourcecolor,textsize=13">
<visual width="63" height="30" type="color" source="[SOURCECOLOR]"/>
<button action="[ACTION]" rightclick="[RIGHTCLICK]">
<size width="63" height="30"/>
<off color="buttonoff" shape="square" border="transparent" border_size="2" radius="2"/>
<over color="buttonover" shape="square" border="transparent" border_size="2" radius="2"/>
<selected color="padbuttonselected" shape="square" border="transparent" border_size="2" radius="2"/>
<down color="buttonon" shape="square" border="transparent" border_size="1" radius="2"/>
<text dx="+4" dy="-3" width="54" fontsize="[TEXTSIZE]" color="textoff2" colorover="textover" weight="bold" colorselected="textselected" colordown="texton" align="center" action="[TEXTACTION]" important="[IMPORTANT]"/>
</button>
 

Posted Sun 15 Dec 19 @ 1:47 pm
djkrysrPRO InfinityMember since 2010
Hi
Thanks for the confirmation, after posting I figured that I was probably trying to do something that doesn't work, logically it's fine but the skin doesn't support it, and figured the best way would be to have a visual or something behind the button that is the color of the sample. Glad you have confirmed it for me.
Thanks
 

Posted Sun 15 Dec 19 @ 2:18 pm


(Old topics and forums are automatically closed)