Sie sind nicht angemeldet.

panomaster

Fortgeschrittener

  • »panomaster« ist der Autor dieses Themas

Beiträge: 270

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

1

Donnerstag, 27. September 2018, 16:41

Hermetising

I'd like to enclose all attributes (properities) and method (actions ) in one krpano object. I hope it's the best way for creating plugins. Something like this:

Quellcode

1
2
3
4
5
6
7
		<layer  name="element_name" type="container"
				<!-- other attributes -->
				...
				<!-- methods/actions -->
				show="trace(get(name))"
				
				>


How to access object attributest in this way? get(name) returns null.

2

Donnerstag, 4. Oktober 2018, 10:20

Hi,

it depends on 'how' will call the code...

When calling that code in your 'show' attribute from an plugin event (e.g. like onclick), it will work, but when calling from somewhere else, then not.

For calling code with a dedicated scope the callwith action can be used:
https://krpano.com/docu/actions/#callwith

E.g.

Quellcode

1
callwith(layer[element_name], show);


Best regards,
Klaus