Accesso rapido:  

Forum: VirtualDJ Skins

Topic: Concatenate text and values in a TEXT element

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

Come on then DJDAD, keep up the 100% record of solving my problems please.

I have added a text zone into the "times" section on my skin to display the other value (elapsed or remain) when the user alters the main (large blue) one. This is my code and it works well:


<textzone action="display_time 'elapsed,remain'">
<Tooltip>Click to toggle between Elapsed and Remain Time view</Tooltip>
<pos x="+107" y="+52"/>
<size width="107" height="19"/>
<text size="14" color="#908F8D" align="left" weight="bold" action="display_time 'elapsed' ? get_time 'remain' : get_time 'elapsed'"/>
</textzone>


When the large coloured time shows "elapsed", this shows the "remain" time and vice versa.

But what I want is to add the required word "ELAPSED" or "REMAIN" BEFORE the time. How to I do this? I've tried so many combinations of ideas, I've run out.

Cheers in advance
Steve
 

Inviato Sat 05 Sep 15 @ 1:46 am
djdadPRO InfinityDevelopment ManagerMember since 2005
<text ... action="get_time"/>
should return the correct time each time.
<text .... action="dsiplay_time 'elapsed' ? get_text 'ELAPSED' : get_text 'REMAIN'"/>
should return the text ELAPSED if the dispaly time is set so, and the text REMAIN otherways.

 

Inviato Sat 05 Sep 15 @ 4:18 pm
Hi there, thanks for getting back to me, but I think you've misunderstood what I'm trying to do.

I'm tweaking the default skin, so imagine the Deck A "times" panel in the top left. This contains a large blue "A", a large blue time (that you can click to alternate between elapsed and remaining) and a small gray time that always shows the total time.

I have moved these around slightly to allow space for another text zone to contain another time. When the large blue time shows elapsed, I want this one to show remaining and vice versa. This way, all 3 times are shown, but the user can decide which one is large and blue.

If the large blue one shows elapsed time for example, I want this new text zone to show "REMAIN 2:27.6" for example.

I can get it to show "REMAIN", by using the code:

<text .... action="display_time 'elapsed' ? get_custom_text 'REMAIN' : get_custom_text 'ELAPSED'"/>


OR I can get it to show the remaining time by using the code:

<text .... action="display_time 'elapsed' ? get_time 'remain' : get_time 'elapsed'"/>


What I want is for it to show the word AND the time on one line.

I know I could use 2 textzone elements, but wondered if I could show it using the one?

Cheers
 

Inviato Sat 05 Sep 15 @ 6:23 pm
djdadPRO InfinityDevelopment ManagerMember since 2005
you can use one line but keep in mind that the entire line will be aligned the same (left, right or center)

<text action="display_time 'elapsed' ? get_text 'ELAPSED `get_time`' : get_text 'REMAIN `get_time`'">

notice that i have used the get_text action which expects a text (e.g. the REMAIN text) and i used the backtilt character to include the action. This makes the action to be executed first, so it will return the time i want and not the text "get_time"
Hope this helps
 

Inviato Sat 05 Sep 15 @ 8:15 pm
Thank you again for fixing my problem. I had to tweak it slightly because I was after the opposite time to the display_time variable, so I used this:


<text action="display_time 'elapsed' ? get_text 'REMAIN `get_time remain`' : get_text 'ELAPSED `get_time elapsed`'">


Sorted
Thanks
 

Inviato Sun 06 Sep 15 @ 6:25 pm


(Vecchi argomenti e forum sono automaticamente chiusi)