Move text in Python
#1
Hey there,

i´m working on a small text ticker addon. That means that, after you had input a desired text, the text is printed to the screen and is moving to the right.
When the text has reached the end it shall start from the left again.

Problem here is that i have no idea how to realise the animation.

Here is my code so far:

PHP Code:
import xbmcaddon
import xbmcgui

__addon__ 
xbmcaddon.Addon()
__addonname__ __addon__.getAddonInfo('name')

input xbmcgui.Dialog().input("Geben sie ihren Text ein: ", )

xbmcgui.Dialog().notification("ausgabe"input)

script xbmcgui.Window()

label xbmcgui.ControlLabel(1010300800input"font35_title")

script.addControl(label)

script.doModal()

posx label.getX()

while(
True):

    
label.setPosition(posx 1label.getHeight()) 
Reply
#2
(2016-01-21, 09:49)seishinsan Wrote: ... the text is printed to the screen and is moving to the right.
When the text has reached the end it shall start from the left again.

So it's not English then?
Reply
#3
what? i just want to move the text/label on the screen.
Reply
#4
http://romanvm.github.io/Kodistubs/docs/...Animations
Reply
#5
there's no need for the while loop. you can add an animation to a control:
http://mirrors.xbmc.org/docs/python-docs...Animations


Code:
label.setAnimations([('conditional', 'condition=true effect=slide start=10,10 end=1280,10 time=5000 loop=true',)])
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
(2016-01-21, 12:21)ronie Wrote: there's no need for the while loop. you can add an animation to a control:
http://mirrors.xbmc.org/docs/python-docs...Animations


Code:
label.setAnimations([('conditional', 'condition=true effect=slide start=10,10 end=1280,10 time=5000 loop=true',)])

yeah, i tried that but it doesn´t work. Nothing is happening with that or any other animation.
Reply
#7
set the animation after adding the control to the window.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
(2016-01-21, 12:53)ronie Wrote: set the animation after adding the control to the window.

doesn´t work. tried to place it everwhere i could already
Reply
#9
works for me.
Code:
import xbmcaddon
import xbmcgui

__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')

input = xbmcgui.Dialog().input("Geben sie ihren Text ein: ", )
xbmcgui.Dialog().notification("ausgabe", input)

script = xbmcgui.Window()

label = xbmcgui.ControlLabel(10, 10, 300, 800, input, "font35_title")
script.addControl(label)
label.setAnimations([('conditional', 'condition=true effect=slide start=10,10 end=1280,10 time=5000 loop=true',)])

script.doModal()
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#10
Thanks ronie, the setAnimations code worked for me.

Code:
ctl3.setAnimations([('conditional', 'condition=true pulse=true effect=zoom end=150 time=2000')])

I'm just adding an observation (I must be missing something):

if you don't add "pulse=true" or "loop=true" you'll end up with just the end of animation.
Setting them to "false" won't work, it has to be "true"


Code:
ctl3.setAnimations([('WindowOpen', 'effect=zoom loop=true start=10 end=150 time=2000') ])
works. loop and pulse is ignored for WindowOpen

testing on krypton windows
Reply

Logout Mark Read Team Forum Stats Members Help
Move text in Python0