From 16404b3ed4496ea446f9ddbd73ef346e6b6a07a6 Mon Sep 17 00:00:00 2001 From: Elia Lazzari Date: Mon, 20 Feb 2023 11:41:23 +0100 Subject: [PATCH] Fixed readme mistake and increased version number --- README.md | 20 ++++++++++++++------ package.json | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d661b2d..f8f965d 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,20 @@ const viewer = new PhotoSphereViewer.Viewer({ ## Methods +To call methods you need to get the plugin instance. + +```js +const lensflaresPlugin = viewer.getPlugin(LensflarePlugin); +``` + +and then you can call the methods. + ### `toggleAllLensflares` Toggle all lens flares. ```js -viewer.toggleAllLensflares(); +lensflaresPlugin.toggleAllLensflares(); ``` ### `showAllLensflares` @@ -81,7 +89,7 @@ viewer.toggleAllLensflares(); Show all lens flares. ```js -viewer.showAllLensflares(); +lensflaresPlugin.showAllLensflares(); ``` ### `hideAllLensflares` @@ -89,7 +97,7 @@ viewer.showAllLensflares(); Hide all lens flares. ```js -viewer.hideAllLensflares(); +lensflaresPlugin.hideAllLensflares(); ``` ### `getNbLensflares` @@ -97,7 +105,7 @@ viewer.hideAllLensflares(); Get the number of lens flares. ```js -const nb = viewer.getNbLensflares(); +const nb = lensflaresPlugin.getNbLensflares(); ``` ### `getLensflares` @@ -105,7 +113,7 @@ const nb = viewer.getNbLensflares(); Get all the lens flares. ```js -const lensflares: LensflareObject[] = viewer.getLensflares(); +const lensflares: LensflareObject[] = lensflaresPlugin.getLensflares(); ``` ### `getLensflare` @@ -113,7 +121,7 @@ const lensflares: LensflareObject[] = viewer.getLensflares(); Get a lens flare. ```js -const lensflare: LensflareObject = viewer.getLensflare('sun'); +const lensflare: LensflareObject = lensflaresPlugin.getLensflare('sun'); ``` ### `addLensflare` diff --git a/package.json b/package.json index 42c0214..5698c26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photo-sphere-viewer-lensflare-plugin", - "version": "1.0.4", + "version": "1.0.5", "description": "Plugin to add lens flares on a 360° pano built with photo-sphere-viewer", "main": "dist/index.js", "module": "dist/index.module.js",