vMix Forums
»
General
»
General Discussion
»
Increasing the "settext" parameter of a title
Rank: Member
Groups: Registered
Joined: 11/5/2021(UTC) Posts: 16 Thanks: 2 times
|
Ok, here goes for without any doubt a stupid question, but I can't seem to find the answer :-) I have a text input, which I will use for live subtitling. I want to increase the Description.Text index with one, on each keypress. I've used the "settext" function on the Title, which works fine if I specify a fixed number. But I want to increase that number with each keypress. I've been playing with DynamicValues, and that works fine also, if I assign a fixed number manually to DynamicValue1, and then assign DynamicValue1 to my description.text using Settext. However, I simply can't seem to figure out how I can increase DynamicValue1 with a keypress. I've been playing with webscripts, vbscripts, just entering DynamicValue1+=1 or DynamicValue1=DynamicValue1+1, but that just replaces the value of DynamicValue with a string, and doesn't increase the number. I must be overlooking something really simple.
So basically my question is: suppose I have DynamicValue1 with a value of 2, how do I, with a keypress, makes sure that it contains the value 3...
Thanks a lot, it's driving my crazy ;-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Few lines of code in vMix scripting Read the content of the DynamicValue1 from the API XML, convert to value and add 1 and do a SetDynamic1 with the new value (tostring). The shortcut calls the script
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/5/2021(UTC) Posts: 16 Thanks: 2 times
|
Originally Posted by: doggy Few lines of code in vMix scripting Read the content of the DynamicValue1 from the API XML, convert to value and add 1 and do a SetDynamic1 with the new value (tostring). The shortcut calls the script Yep, I seemed to be stuck on the "read the content". It was quite a bit more complex then I thought, but I've got it working, thanks ! For people interested: dim Dynamic1Val as Integer= 1 dim VmixXML as new system.xml.xmldocument VmixXML.loadxml(API.XML) dim Dynamic1Node As XmlNode = VmixXML.selectSingleNode("/vmix/dynamic/value1") Dynamic1Val = Dynamic1Node.InnerText Dynamic1Val+=1 API.Function("SetDynamicValue1", Value:=Dynamic1Val)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: fideba I have a text input, which I will use for live subtitling. I want to increase the Description.Text index with one, on each keypress. I've used the "settext" function on the Title, which works fine if I
Still confused though in regards to the "index" want to increase the nummer displayed in the text field ? Its content has to start with a value ( say 0) then just do a SetText of that field with a +=1 as value BTW code to read API XML has been posted numerous times (see scripting for dummies post) And if one wants to post code please use the language syntax highlighting to quote it Code:dim Dynamic1Val as Integer= 1
dim VmixXML as new system.xml.xmldocument
VmixXML.loadxml(API.XML)
dim Dynamic1Node As XmlNode = VmixXML.selectSingleNode("/vmix/dynamic/value1")
Dynamic1Val = Dynamic1Node.InnerText
Dynamic1Val+=1
API.Function("SetDynamicValue1", Value:=Dynamic1Val)
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Increasing the "settext" parameter of a title
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close