logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
NSCPro  
#1 Posted : Friday, December 8, 2023 6:59:26 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

Hi.

How to make scrollable text. If text longer than graphics element, it's scrolling, other way, if text not long, no scrolling

Thank you
doggy  
#2 Posted : Friday, December 8, 2023 12:16:56 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: NSCPro Go to Quoted Post
Hi.

How to make scrollable text. If text longer than graphics element, it's scrolling, other way, if text not long, no scrolling

Thank you


Code:
put text in textblock and ticker
calculate length of text

if length is longer than textblock
   show ticker
else 
   show textblock
end if
NSCPro  
#3 Posted : Friday, December 8, 2023 8:34:15 PM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

I must add this code to script?
doggy  
#4 Posted : Saturday, December 9, 2023 3:55:29 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: NSCPro Go to Quoted Post
I must add this code to script?


No this isnt the code. its a description of the logic to use
NSCPro  
#5 Posted : Saturday, December 9, 2023 4:58:10 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

Do you have some sample how do that?
Peter1000  
#6 Posted : Saturday, December 9, 2023 6:21:04 AM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 303
Switzerland

Thanks: 17 times
Was thanked: 79 time(s) in 60 post(s)
Here is an example of how to determine the length of a text and perform different actions based on the length.
However, this is not a turnkey solution to your problem, that will require a little more work on your part.
There is probably also such an example in doggy's "scripting for dummies" always a worthwhile way to solve such questions.

Code:
dim text as string
dim count As Integer

'the next line gets a text from a title
text = input.find("Title 0- The Classic Blue.gtzip").Text("Headline.Text")
'the next line counts how many characters are in the text
count = text.length

console.writeline (text)
console.writeline (count)

If count > 10 Then
    console.writeline ("count is greater than 10")
    'here you could start your ticker
Else
    console.writeline ("count is not greater than 10")
    'here you could start your title
End If

'the console.writeline lines are only for your information in the script window
'adjust the number, in this example 10, to your needs
doggy  
#7 Posted : Saturday, December 9, 2023 6:40:59 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,223
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: NSCPro Go to Quoted Post
Do you have some sample how do that?


a textbox and a ticker having a width of about 15 characters for example of the used font (not precise when using proportional fonts ) one on top of the other

Code:
dim boxlength as integer = 15

do while true
dim TickerText as string = Input.Find("sometitle.gtzip").Text("TextBlock1.Text" ) 
dim length as integer= TickerText.Length() 

If length >= boxlength 
   API.Function("SetTextVisibleOff",Input:="textorticker.gtzip",SelectedName:="TextBlock1.Text" )
   API.Function("SetTextVisibleOn",Input:="textorticker.gtzip",SelectedName:="Ticker1.Text" )
else
   API.Function("SetTextVisibleOn",Input:="textorticker.gtzip",SelectedName:="TextBlock1.Text" )
   API.Function("SetTextVisibleOff",Input:="textorticker.gtzip",SelectedName:="Ticker1.Text" )
end if
sleep(100)
Loop


wonder why you don't use automatic textbox resizing instead as IMO it looks weird ( to put it nicely)
Users browsing this topic
Guest
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.