You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

1

Saturday, September 19th 2009, 5:38am

align textfield with cursor

How do I align the textfield with the cursor?

I've tried align="cursor" and original="cursor" with no luck.. any ideas?

I want the html text effect in the textstyles document, in a graphic (speech bubble) that moves with the cursor.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Sunday, September 20th 2009, 12:44pm

Hi viewinz,

Why to not use the showtext action in combination with a <textstyle> ?
<textstyle> have the attribute origin to set textposition to mouse cursor :
origin
"cursor" - set textposition to mouse cursor (=default)
for a fixed positon on screen use one of these values:
"lefttop", "left", "leftbottom", "top", "center", "bottom", "righttop", "right", "rightbottom"

A possible code would be something like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<textstyle name="SpeechBubble"
	   font="Arial"
	   fontsize="20"
	   border="false"
	   effect="glow(0xFFFFFF,1,16,4);"
	   bold="true"
	   background="true"
	   origin="cursor"
	   edge="leftbottom"
	   xoffset="-10"
	   yoffset="-20"
	   />

<some plugin or hotspot>
	......
	onhover="showtext(Quoi de neuf[br]docteur ?,SpeechBubble);"
	......
	/>


Perhaps this can do the job. *smile*

A new tag for the showtext action as something like [img src=""] would be great to do something like what you are looking for... *rolleyes*
Or a new attribute for the <plugin> node like origin="cursor"...
Klaus, perhaps this can be implemented on future version. *smile*

Salut.

3

Monday, September 21st 2009, 11:55pm

A new tag for the showtext action as something like [img src=""] would be great to do something like what you are looking for... *rolleyes*
that will work
the '[' and ']' are will be just replaced by '<' and '>'
but the HTML Renderer of the Flashplayer is really buggy, especially the <img> tag,
I found the following solution - a [br] is needed before and after the [img] to make it visible,
but then the image is still a bit cutted, to fix this too - use a [textformat] tag with a leftmargin,
e.g.

Source code

1
... onhover="showtext([textformat leftmargin='20'][br][img src='krpano_logo.png' width='180' height='50' /][br][/textformat], imagetextstyle);"


and this would be a textstyle for such: (disabled background, border, ...)

Source code

1
<textstyle name="imagetextstyle" background="false" border="false" origin="cursor" edge="leftbottom" xoffset="-40" yoffset="10" />



[quote='michel',index.php?page=Thread&postID=7901#post7901]Or a new attribute for the <plugin> node like origin="cursor"...
Klaus, perhaps this can be implemented on future version. *smile* [/quote]maybe, but making all plugins listen to mouse moves will not be good for performance [img]wcf/images/smilies/wink.png[/img]

best regards,
Klaus

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

4

Tuesday, September 22nd 2009, 7:04am

Brilliant. Got that working great!

Next question - how do I lay text over the image? i.e. speech bubble background, with text in the bubble?

I've had a look at the livedocs regarding this and it seems it might be difficult.

Would a better way to be maybe make the graphic (speech bubble) into an swf and get the text into there? Not sure how I would do that as it needs to be generated from the xml datasource. Would I do something like create a dynamic textfield over the image with the variable 'hstext' in the new swf and in the xml on the onover set the variable 'hstext' as the relevant data content? My flash knowledge isn't great so before I embark on this and spend days over it I would like to know it's possible! *confused*

The other thought I had was in the onover make the cursor the graphic, would that work?

Thanks lots for your help! *cool*

This post has been edited 2 times, last edit by "viewinz" (Sep 22nd 2009, 8:49am)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

5

Tuesday, September 22nd 2009, 9:25am

Hi viewinz,

I have tried to call 2 showtext action (one with the bubble background, the other with the text foreground) in different way but it seems that showtext action can be called only 1 time... the last call is the one it is displayed... *sad*
Do not see a way to do... *confused*

Salut.

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

6

Wednesday, September 23rd 2009, 8:12am

Michel,

Thanks for that. I tried that also. I also tried multiple hotspots and changing the zorder etc, all with the same result - only one showtext works.

I'm hoping their might be a solution from the other method I thought might work

Next thing I'll going to try is setting the cursor to a graphic and seeing if the showtext will overlay that!? *unsure*

viewinz

Intermediate

  • "viewinz" started this thread

Posts: 145

Location: Wellington, New Zealand

Occupation: Trying to build an entire walkthrough of NZ for tourists

  • Send private message

7

Thursday, September 24th 2009, 1:47am

getting there.. Just need to keep the graphic showing on cursor when hotspot is accessed

I've had limited success by changing the cursor. I can get the cursor to change to the graphic, and hopefully show text should overlay it.

BUT.. when you roll over a hotspot, the cursor disappears.

And before you ask, handcursor="false"!

Source code

1
<hotspot name="pier2ferry" ath="-150" atv="0"         keep="false"         visible="true" enabled="true" handcursor="false" capture="false" children="false" zorder="10"         fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"         fillcolorhover="0xffffff" fillalphahover="0.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"         onover="set(cursors.url, %SWFPATH%/hs.png)"         onhover=""         onout=""         ondown="hs(ferry,ferry2pier)"         onup=""         onclick="" onloaded=""         flying="0"><point ath="178.2174" atv=" -1.4540" /><point ath="-125.5751" atv="  0.1901" /><point ath="-126.1102" atv=" 11.4175" /><point ath="-151.2046" atv=" 21.4357" /><point ath="177.8108" atv="  2.4959" /><point ath="173.8779" atv="  1.6940" /><point ath="174.0857" atv=" -0.0742" /><point ath="177.6207" atv="  0.1228" /></hotspot>



Anyone know how to change the cursor and keep the cursor changed while over a hotspot and with showtext appearing over the new cursor?

8

Thursday, September 24th 2009, 8:33am

Hi,
Next question - how do I lay text over the image? i.e. speech bubble background, with text in the bubble?
I think that will not be possible with only xml at the moment...
(showtext() can only show one text at one time at the moment)

Would a better way to be maybe make the graphic (speech bubble) into an swf and get the text into there? Not sure how I would do that as it needs to be generated from the xml datasource. Would I do something like create a dynamic textfield over the image with the variable 'hstext' in the new swf and in the xml on the onover set the variable 'hstext' as the relevant data content? My flash knowledge isn't great so before I embark on this and spend days over it I would like to know it's possible! *confused*
doing it via AS3 would be possible of course,
but it will require some as3 knowledge...

I will try to post an example here:
http://www.krpano.com/forum/wbb/index.ph…D=7971#post7971


The other thought I had was in the onover make the cursor the graphic, would that work?
no, on hover the cursor will change again...
but in the case it would work, you had also only a graphic, without text...

best regards,
Klaus

Similar threads