Added jsdoc for Scrollview.
This commit is contained in:
@@ -49,7 +49,7 @@ app.loader
|
||||
const sprite2 = new PIXI.Sprite(resources.elephant2.texture)
|
||||
const sprite3 = new PIXI.Sprite(resources.elephant3.texture)
|
||||
|
||||
const scrollview1 = new Scrollview({boxWidth: 300, boxHeight: 180})
|
||||
const scrollview1 = new Scrollview({boxWidth: 400, boxHeight: 180})
|
||||
scrollview1.content.addChild(sprite1)
|
||||
app.scene.addChild(scrollview1)
|
||||
|
||||
|
||||
+10
-42
@@ -1,39 +1,7 @@
|
||||
import Scrollbox from './scrollbox.js'
|
||||
|
||||
/**
|
||||
* Callback for the switch action.
|
||||
*
|
||||
* @callback actionCallback
|
||||
* @param {object} event - The event object.
|
||||
* @param {Switch} switch - A reference to the switch (also this refers to the switch).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Callback for the switch action.
|
||||
*
|
||||
* @callback actionActiveCallback
|
||||
* @param {object} event - The event object.
|
||||
* @param {Switch} switch - A reference to the switch (also this refers to the switch).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Callback for the switch beforeAction.
|
||||
*
|
||||
* @callback beforeActionCallback
|
||||
* @param {object} event - The event object.
|
||||
* @param {Switch} switch - A reference to the switch (also this refers to the switch).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Callback for the switch afterAction.
|
||||
*
|
||||
* @callback afterActionCallback
|
||||
* @param {object} event - The event object.
|
||||
* @param {Switch} switch - A reference to the switch (also this refers to the switch).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class that represents a PixiJS Switch.
|
||||
* Class that represents a PixiJS Scrollview.
|
||||
*
|
||||
* @example
|
||||
* // Create the app
|
||||
@@ -43,14 +11,14 @@ import Scrollbox from './scrollbox.js'
|
||||
* height: 250
|
||||
* }).setup().run()
|
||||
*
|
||||
* // Create the switch
|
||||
* const switch1 = new Switch({
|
||||
* x: 10,
|
||||
* y: 20
|
||||
* })
|
||||
*
|
||||
* // Add the switch to a DisplayObject
|
||||
* app.scene.addChild(switch1)
|
||||
* // Create the Scrollview
|
||||
* app.loader
|
||||
* .add('elephant', './assets/elephant-1.jpg')
|
||||
* .load((loader, resources) => {
|
||||
* const sprite = new PIXI.Sprite(resources.elephant.texture)
|
||||
* const scrollview = new Scrollview({boxWidth: 400, boxHeight: 180})
|
||||
* scrollview.content.addChild(sprite)
|
||||
* app.scene.addChild(scrollview)
|
||||
*
|
||||
* @class
|
||||
* @extends PIXI.extras.Scrollbox
|
||||
@@ -60,7 +28,7 @@ import Scrollbox from './scrollbox.js'
|
||||
export default class Scrollview extends Scrollbox {
|
||||
|
||||
/**
|
||||
* Creates an instance of a Switch.
|
||||
* Creates an instance of a Scrollview.
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user