You are not logged in.

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,839

Location: Netherlands

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

  • Send private message

1

Friday, October 30th 2015, 4:29pm

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);

Source code

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*

This post has been edited 1 times, last edit by "Tuur" (Oct 30th 2015, 4:55pm)


martyhr

Intermediate

Posts: 387

Location: CZ

  • Send private message

2

Friday, October 30th 2015, 7:25pm

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

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

Sergey74

Intermediate

Posts: 193

Location: Russia, Chelyabinsk

Occupation: professional noob

  • Send private message

3

Friday, October 30th 2015, 8:01pm

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

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Friday, October 30th 2015, 8:46pm

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

Alexey

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

5

Monday, November 2nd 2015, 7:56am

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

Source code

1
set(twt, %1); 
to

Source code

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

Alexey

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,839

Location: Netherlands

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

  • Send private message

6

Monday, November 2nd 2015, 12:07pm

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*

This post has been edited 1 times, last edit by "Tuur" (Nov 2nd 2015, 1:27pm)


Destiny

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

7

Tuesday, November 10th 2015, 1:11am

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

Sage

  • "Tuur" started this thread

Posts: 3,839

Location: Netherlands

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

  • Send private message

Destiny

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

9

Tuesday, November 10th 2015, 11:40am

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

Sage

  • "Tuur" started this thread

Posts: 3,839

Location: Netherlands

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

  • Send private message

Destiny

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

11

Wednesday, November 11th 2015, 9:20pm

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...

Source code

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

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

12

Friday, November 13th 2015, 9:32pm

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*