Connexion rapide:  

Forum: VirtualDJ Skins

Sujet Setting text strings in variables, using them in textarea

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

SupaconPRO InfinityMember since 2005
I'd like to use the new VDJ7 feature that allows the use of variables in textarea with backquotes (ie format="Variable: `get var $variable`").
Edit:
I realized that my problem here was that I was missing "var" from the format string.

I'm wondering if it's possible to set text strings other than numbers into variables... ie "set $variable 'Hello world'". I'm guessing that it is not possible given that the documentation doesn't say anything about this.


FYI, I'd like to use such a string to show the description of the currently active pannel in a skin. I'm trying to implement this in the stock VDJ7 4 deck skin as a test at the moment.
 

Posté Sat 06 Nov 10 @ 12:38 pm
SupaconPRO InfinityMember since 2005
I've found a workaround to this problem:

If I just assign a number to the variable, then within the backquotes in a format string, I can do a long, convoluted if/else test to output my desired text.

It's convoluted, and not exactly elegant, but gets the job done. Here's a code example:

format="Wavename `var_equal $wavename 1 ? get text 'Test 1' : var_equal $wavename 2 ? get text 'Test 2' : var_equal $wavename 3 ? get text 'Test 3'`"
 

Posté Sat 06 Nov 10 @ 1:09 pm
SupaconPRO InfinityMember since 2005
If anyone is interested, I ended up solving my exact problem without using variables at all... I did have to use the same kind of if/else logic, though... but I just could use the value of the pannel to determine whether I should set the text to a certain value.

Here's the code. You can try this yourself by replacing the "wave" pannel selector button in VDJ7 4 deck 1440 with the following:


<button action="skin_pannel '4waves' on ? skin_pannel '2waves' on : skin_pannel '2waves' on ? skin_pannel 'double' on : skin_pannel 'double' on ? skin_pannel 'inverted' on : skin_pannel 'inverted' on ? skin_pannel 'grouped' on : skin_pannel 'grouped' on ? skin_pannel 'groupedparts' on : skin_pannel 'groupedparts' on ? skin_pannel 'topscratch' on : skin_pannel '4waves' on">
<pos x="519" y="6"/>
<size width="46" height="17"/>
<tooltip>Change Waveform</tooltip>
</button>

<textzone>
<size width="100" height="21"/>
<pos x="410" y="6"/>
<text font="arial" size="17" weight="bold" color="#808080" align="right" format="`skin_pannel '2waves' ? get text '2waves' : skin_pannel 'double' ? get text 'double' : skin_pannel 'inverted' ? get text 'inverted' : skin_pannel 'grouped' ? get text 'grouped' : skin_pannel 'groupedparts' ? get text 'groupedparts': skin_pannel 'topscratch' ? get text 'topscratch': skin_pannel '4waves' ? get text '4waves'`"/>
</textzone>


 

Posté Sat 06 Nov 10 @ 1:44 pm
Question.

Could you added the textzone as part of the button itself?

<button>
.
.
.
<text...>
</button>

I appreciate in your example you won't but in theory you could??
 

Posté Sat 06 Nov 10 @ 2:14 pm
SupaconPRO InfinityMember since 2005
I actually wasn't aware that you could put text in a button like this. Interesting...

I tested it out, and it did not work well for me, however. I had a problem where the button graphic wouldn't refresh properly so that the old text was still visible, and you'd end up with a streak of pixels that prevents the text from being legible.

Is this a bug in VDJ?
 

Posté Sat 06 Nov 10 @ 2:19 pm
You need to have an up image in the button and the 'pixels' go.

It looks something like this:

<button action="X">
<size width="71" height="22"/>
<pos x="9" y="170"/>
<up x="589" y="3519"/>
<selected x="10" y="1068"/>
<down x="10" y="1068"/>
<over x="83" y="1068"/>
<text dx="3" dy="6" width="65" font="Calibri" size="13" color="#00FFFF" align="center" format="X" scroll="no"/>
</button>
 

Posté Sat 06 Nov 10 @ 2:28 pm
SupaconPRO InfinityMember since 2005
Oh, cool. I rarely use the "up" element, because it's usually redundant.
This works quite well now... I will probably use this example in my next skin :)
 

Posté Sat 06 Nov 10 @ 2:31 pm


(Les anciens sujets et forums sont automatiquement fermés)