Hoy!
I tried to fix by giving an actual name to the sub-item using txtadd(subName, "sub", get(i)) but I had the same behaviour.
A magic moment :)
Regards
Posts by Anoril
-
-
Hi there!
I'm working on some stuff and I have to efficietly parse children of Layers. Because I got a lot of layers and children, I decided to store the children nodes into a parent array instead of having a loop through all layers available. (That may be inconsistent, just tell me if you have better idea).
OK, to get you see, Here is the expected structure:
This structure is created by an action:
Code
Display MoreaddLayer("Parent"); set( layer[%1].onclick, showSubItems ); for( set(i,0), i LT 2, inc(i), txtadd(childName, "Child", get(i)); addLayer(get(childName)); set( layer[get(childName)].parent, layer["Parent"]); copy( layer["Parent"].subItems[get(i)].item, layer[get(tagName)]); );
This works like a charm.
The point is that the "showSubItem" action acts correctly with a direct "show" command:
Code<action name="showSubItem"> for( set(i, 0), i LT subItems.count, inc(i), set( subItems[get(i)].item.alpha, 1.0 ); ); </action>
But when using a TWEEN command, it works ONLY for the items with index greater than 0... i.e. the first item (idx=0) does not show.
Code<action name="showSubItem"> for( set(i, 0), i LT subItems.count, inc(i), tween( subItems[get(i)].item.alpha, 1.0, 3.0 ); );</action>
Note that I found a workarround by modifying the index reference (saying it's a nonsense, as the index will ever be 0-N, but anyway, there is here a black-magic trick):Code
Display MoreaddLayer("Parent"); set( layer[%1].onclick, showSubItems ); for( set(i,1), i LE 3, inc(i), txtadd(childName, "Child", get(i)); addLayer(get(childName)); set( layer[get(childName)].parent, layer["Parent"]); copy( layer["Parent"].subItems[get(i)].item, layer[get(tagName)]); );
I guess it is something about item-array naming convention or somewhat...
Regards,
Paul
-
Hi indexofrefraction!
Thanks for the answer. My point is that I should pass an array.
I read Action are limited to 99 params, that is a first limitation, and the second is that I don't know how to access params in a form of an array (like in JS: "args[idx]").
Today, I have about 50 params (items in my array) but in production, it might go up to 10 000 000 items :P
Regards -
Hello all!
I'm playing with KRPano and for some technical and performances reasons, I decided to work in XML file with both Javascript and Native actions.
Today, I'm struggling hard to get the things work together! :)
Calling is an javascript-type action from a standard KRPano native-action is straight forward:Code<action name="caller"> callee(); </action> <action name="callee" type="javascript"> console.debug("yeepee"); </action>
But for some technical reasons, it's more complicated the other way:Code<action name="caller" type="javascript"> krpano.call("callee()"); </action> <action name="callee"> trace("yeepee"); </action>
When the Big Deal comes, it is when we start talking about parameters... Once again, Native-to-JS is trivial, but the other way is not.
I ended to this point: because I must give my actions arrays, I instanciate arrays in calls before to call the expected actions:Code<action name="caller" type="javascript"> var val1 = "plouf"; var val2 = 4*6; krpano.call("def(my_array, array);set(my_array[0], "+val1+");set(my_array[1], "+val2+");callee()"); </action> <action name="callee"> trace("Provided values are:", get(my_array[0]), " / ", get(my_array[1])); </action>
I'm not sure this is very optimal ;) and it looks very.very ugly :D
Do you know a better way?
Image I work with very long arrays I have to declare in loops and construct a call-string before to launch the action... This is very poor in performance. :/
Best regards and thanks for your enlightened help! -
Thanks!
It works but I don't like the calculus it implies... By the way, I suppose I'm not in a situation where a mul and a test is a killer. :)
Thanks again!
Paul -
Hello!
I am asking myself: How do I check SphereToScreen result validity?
A call set vars with resulting data, but some times, when hotspots are out of screen, data is "NaN".
My point is that I don't know how to test "NaN"...CodesphereToScreen(a, b, c, d); if( c == NaN, trace(is NaN), trace(is not NaN)); if( c == Number.NaN, trace(is NaN), trace(is not NaN));
Above code does not work...
I tried to check against screen dimensions, but that fails too : NaN is both greater and lesser than any number ;)regards,
-
Hi !
I'm experiencing a destabilizing behaviour with arrays.
I want a global array to store data. In a high-level action, I ask for array creation as documented:
Then I start using it:
But this tells me :QuoteWARNING: set miaou[0].stuff=meow - miaou is not an array!
... WHY ?!?
If I don't use DEF(), it works... ^_^ But I don't really like using data I don't initialize...
Pleaaaase, help ! :D -
Oh, yes!
Thank you Tuur! I thought MaskChildren was only purposed to hide inner stuff, but I realise it evolved and now deal with parent CSS boxing.
This is a bit limitating (to rectangles, rounded-rectangles and circles) but that helps!
Many thanks for the update and to point it out!
Regards,
Paul -
Hello!
I'm trying to make use of this mask attribute, but with no success. It seems it is no more available on Hotspots, am I correct?
When I update the sample given by Klaus to 1.19, I just end with a white blured circle wandering arround. :/
How to get it work with 1.19?
Best regards, and all my best wishes for the new year!
Paul -
I first supposed the issue can come from the fact I have several XML files and, maybe, loading them (using "include") would have strange behaviours.
I then placed all the content in a single XML file, but the issue remains.
Regards,
-
Hi!
I'm going crazy with scene loading issues. (1.19-pr4 up to 6)
This project : http://anoril.no-ip.com/360/DemoHeadset/ does not work the same way on Mobile and laptop browsers.
Even in Chrome, it does not play the same way as in Chrome emulating a device!1_ On mobile, my first scene is played and quickly replaced with the second scene, which is not called with "loadscene" from anywhere!
Using a laptop browser (Forefox/Chrome) all works fine: the first scene is loaded, played successfully and that's it. On mobile devices (or emulated) the second scene is loaded and start to play, overriding first scene content... :(2_ I can't play a video twice.
The menu show four buttons which load a specific scene (360 video). When the video ends, we reload the menu scene. If we click again on an already-play-video-button, nothing happens: the video, which has been restarted (seek(0), pause()) does not read anymore...Files are there:
http://anoril.no-ip.com/360/DemoHeadset/root.xml
http://anoril.no-ip.com/360/DemoHeadset/content/credits.xml
http://anoril.no-ip.com/360/DemoHeadset/content/menu.xml
http://anoril.no-ip.com/360/DemoHeadset/content/videos/xmlBest regards
Paul
[EDIT]
OK, the point was I copied Klaus' code but missed to unterstand it plainfully: the mobile device trick was to start the videos on user interaction THEN to pause them. Because I have four videos, I wrote a loop to achieve this. But the "delayedcall" was using an inconsistent for-i value then was pausing only the last video of the list... Because video ending triggers menu laoding, well... I was redirected to menu...And this happened only on devices because video autostart behaviours is "devices=mobile"... :)
-
Hello all!
I'm trying to get this working:
A WebVR experience with an animated introduction.
The introduction consists in several logos and texts to be displayed, one after the other, in full-stage: a black background layer hides the 360 view while logos are displayed. At the end, I hide the background layer to get the user viewing the actual panorama.
I made this with simple delayed calls and it works fine.But I want it to work with a VR headset. So I placed a "Start" button which triggers "webvr.enterVR(); startIntro();"
This works too: we enter VR mode and the introduction animation starts.My point is that the introduction is played FULLSCREEN! I mean: Instead of having a 3d imersive view with the introduction displayed on EACH eye, the layers (background, images and texts) composing the introduction are displayed on BOTH eyes: a single image is cut in half, having a part seen on the left eye while the other part is seen on the right eye! Very disturbing...
How can I do?
First, to get the layers working, I set "vr" to "true" thus they are not removed when entering VR mode... But I supposed that's not enough...
Best regards,
Paul
-
Hello!
I'm still having this king of issue (1.19-pre5) : I can't resize my text in HTML5 using textfields (I did not tried Flash and I'm not interrested in Flash anymore ;) ).
I had to make use of an external HTML page to be displayed using CSS trick "font-size: 18vm" (with "vm" not yet accepted by all browser ^_^' ). Actually, "vm" is not understood by KRPano even when let managed by the browser (weird to me actually...)
So, if you have an esay step to get my Textfield content scaled to my viewport, I would greatly appreciate! :)
Thanks all,
Paul
-
Ahahah !
How dumb I could be... :) Thanks a lot for the note, Tuur! Many thanks!
Paul, The Blind One
-
Hello all!
I experience a strange issue with Autorotate.
For the first time, I want to programmatically activate it or disable it. Thus I got an action that calls, as depicted in the documentation, "autorotate.start()".
But when it comes to call this, I have this error message:
It works when I use
I a bit disapointed :)
I'm using 1.19-pr3, HTML5, Win7, Firefox.
Best regards,
Paul
-
Hello!
Same issue on my side with 19-pre4. I'll check if there is no redefinition of the call somewhere in the code...
Regards,
-
Hi!
Got the same issue on 19-Pre4.
I'll go search for the code if there is no redefinition of the call somewhere... :)
Regards
-
Hi!
Thanks for your help SVB, and for the fix, Klaus!
Warm regards,
-
Hi!
Thanks Tuur! I'll get a glance to this!
Regards,
-
Hello there!
I raise this thread as I'm very interested in having that king of data from a sound (html5 only).
Maybe someone has a pretty solution (or Klaus has?)...
For those interested with a workaround, I would set a kind of "data" tag with file name and manually entering the time I KNOW it is. Then , by using the frame rate/timeelapsed, you are able to know the percent of the file played.
The Very Ugly Way:
(I'm sure a better person that I will produce a more efficient code)Code<data name="soundstuff" fileurl="my.mp3" length="180" elapsed="0" /> <action name="onstartsound"> tween(data["soundstuff"].elapsed, 1, get(data["soundstuff"].elapsed), default, trace("finished :)")); </action> <action name="onrefresh"> trace("We are at ", get(data["soundstuff"].elapsed), "/", get(data["soundstuff"].length), " of the file..."); </action>
I know. It's awful, but it's the way I found ;)