Sie sind nicht angemeldet.

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

1

Freitag, 30. Oktober 2015, 16:29

typewriter effect

Hi,

i was doing some research and made this small typewriter effect.
Just put this code in your xml and call Typewriter('yourtext',the-name-of-the-layer-where-you-want-to-show-it);
Like : TypeWriter('Hello World', txtfield2);

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<tw speed="0.08" /> 

<action name="TypeWriter">
	set(t, 0);
	set(twt, %1); 
	set(twl, %2); 
	set(l, get(twt.length));
	delayedcall(0, DoTypeWriter());
</action>

<action name="DoTypeWriter">
	subtxt(tws, get(twt), get(t), 1);
	txtadd(tot, get(layer[get(twl)].html), get(tws));
	set(layer[get(twl)].html, get(tot));
	inc(t);
	if(t LT l, delayedcall(get(tw.speed), DoTypeWriter()); );
</action>


example http://www.virtualtuur.com/krpano/typewriter/1/index.html

small question: When i want to use the 'calc' in this line: set(layer[get(twl)].html, get(tot)); it makes 0's (zero's) of the spaces or so..as you can see here: http://www.virtualtuur.com/krpano/typewriter/2/index.html
is there a work around for that?

Have fun!
Tuur *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Tuur« (30. Oktober 2015, 16:55)


2

Freitag, 30. Oktober 2015, 19:25

HI TUUR,
THIS IS NICE.
THANKS FOR YOUR PIECE OF CODE :-)

http://www.virtualczech.cz/klasterck/

Sergey74

Fortgeschrittener

Beiträge: 193

Wohnort: Russia, Chelyabinsk

Beruf: professional noob

  • Nachricht senden

3

Freitag, 30. Oktober 2015, 20:01

Excellent, it can be useful!
translation difficulties *huh*

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

4

Freitag, 30. Oktober 2015, 20:46

Wow! Cool stuff, Tuur! *thumbsup* *thumbup*
Regards,

Alexey

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

5

Montag, 2. November 2015, 07:56

One improvement here) ;-)

The action didn't work with commas inside the target text (e.g. 'Hello, world!' didn't work). I found that the comma was the reason. Then I traced all inside the 'TypeWriter' action and found the way to fix it: replace the line

Quellcode

1
set(twt, %1); 
to

Quellcode

1
set(twt, '%1'); 
(apostrophes added to parameter), and it works also with commas.
Regards,

Alexey

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

6

Montag, 2. November 2015, 12:07

Hi,

Yes, you can do that of course, but it really depends how you want to use it i think..
edit: after some testing i think you are right. I had it in the first place but took it out later.

i made small hotspot example.
http://www.virtualtuur.com/krpano/typewr…spot/index.html

Tuur *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Tuur« (2. November 2015, 13:27)


Destiny

Schüler

Beiträge: 61

Wohnort: Australia

Beruf: Primary School Teacher and Freelance Photographer

  • Nachricht senden

7

Dienstag, 10. November 2015, 01:11

I like that Tuur... How did you attach the text to a hotspot..

Destiny..
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

Destiny

Schüler

Beiträge: 61

Wohnort: Australia

Beruf: Primary School Teacher and Freelance Photographer

  • Nachricht senden

9

Dienstag, 10. November 2015, 11:40

Hi..

Tests are all I ever do.. :) Painful when they do not work.. :( Great when they do.. :)

I tested out some special effect text a couple of years ago but put it on the shelf until I see your post which has made me look at it again..

I got this far... A bit different to yours in many ways..

What I really wanted to do is add it directly to the hotspot but I could not work it out..

http://www.destinyvirtualtours.com/PTPAn…imatedText.html

I need some sleep right now but I will get back to this later..

Thank you...

Destiny..
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

Destiny

Schüler

Beiträge: 61

Wohnort: Australia

Beruf: Primary School Teacher and Freelance Photographer

  • Nachricht senden

11

Mittwoch, 11. November 2015, 21:20

The code is available from Github.. Free.. I will try to find the link for you... Its been a while since I downloaded it..

Destiny...

Quellcode

1
2
3
4
5
[quote='Tuur','index.php?page=Thread&postID=62946#post62946']Hi,

also interesting ;-)

Tuur *thumbsup*[/quote]
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*

Destiny

Schüler

Beiträge: 61

Wohnort: Australia

Beruf: Primary School Teacher and Freelance Photographer

  • Nachricht senden

12

Freitag, 13. November 2015, 21:32

Here you are Tuur...

https://jschr.github.io/textillate/

Have fun...

Destiny..
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*