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.

1

Friday, December 12th 2014, 7:29am

layertoscreen problem

Hi!

Am I doing something wrong here? I can't figure it out no matter what I try.

Source code

1
2
3
4
5
console.log(krpano.get("layer[rwl_fsmzob].x"));
console.log(krpano.get("layer[rwl_fsmzob].y"));
krpano.call("layertoscreen(rwl_fsmzob,layer[rwl_fsmzob].x,layer[rwl_fsmzob].y,sx,sy)"); 
console.log(krpano.get("sx"));
console.log(krpano.get("sy"));


This produces 0, 0, null, null in the log...

I read through the documentation several times, and can't find any problems. The layer in question is NOT rotated...it's a textfield layer, but I tried it with png graphics and got the same results. Any ideas?

2

Saturday, December 13th 2014, 1:27pm

Hi,

the 'call' is not necessarily synchronized to Javascript, it just puts the call into a queue of actions.
That means the 'layertoscreen' might be not executed when you call the 'get'.

For more details please post a link to the example.

Best regards,
Klaus

3

Saturday, December 13th 2014, 3:17pm

Thanks for the tip. I'm not at my workstation right now, but a bit later I'll try to figure out whether it's a synchronization issue like you say. Will get back with the result. Cheers!