Files
JiboOs/docs/rendering/gui/components/MenuButton.js

152 lines
4.6 KiB
JavaScript
Raw Normal View History

2026-03-16 13:53:01 +02:00
/**
* @interface jibo.face.views.MenuButton~MenuButtonOptions
* @extends jibo.face.views.StandardButton~StandardButtonOptions
* @description Interface describing data provided in the config.
* @prop {Number[]|String} [colors] - Array with colors that can be used for button filling.
* @prop {String} [label] - Value for the text label to be shown for the button.
* @prop {String} [iconSrc] - Path to the icon placed inside of the button.
*/
/**
* @interface jibo.face.views.MenuButton~ButtonData
* @description Interface for required data for MenuButton types.
* @prop {String} assetPath - Path to button timeline source.
* @prop {jibo.face.views.Element~DimensionData} dimensions - Width and height of button.
* @prop {String} [cache] - Optionally define cache.
*/
/**
* Menu button.
*
* @class MenuButton
* @extends jibo.face.views.StandardButton
* @memberof jibo.face.views
*/
/**
* The default class identifier.
* Generally used to register the class.
* @name jibo.face.views.MenuButton.DEFAULT_TYPE
* @type {String}
* @readOnly
*/
/**
* Text to appear below the MenuButton
* @name jibo.face.views.MenuButton#label
* @type {String}
*/
/**
* MovieClip that may be placed inside of the MenuButton instead of a static image
* @name jibo.face.views.MenuButton#iconMovieClip
* @type {PIXI.animate.MovieClip}
*/
/**
* Array of 2 colors to be applied to button base.
* @name jibo.face.views.MenuButton#_colors
* @type {number[]}
* @private
*/
/**
* Mapping for button-specific data.
* @name jibo.face.views.MenuButton#_buttonURIs
* @type {Object}
* @private
*/
/**
* String identifier for skill button.
* @name jibo.face.views.MenuButton.SKILL
* @type {string}
* @readOnly
*/
/**
* String identifier for action button.
* @name jibo.face.views.MenuButton.ACTION
* @type {string}
* @readOnly
*/
/**
* String identifier for large action button.
* @name jibo.face.views.MenuButton.ACTION_BIG
* @type {string}
* @readOnly
*/
/**
* The predefined dimensions of the button.
* This only returns the dimensions that have been explicitly set;
* it does not return the dimensions of the display itself.
* @name jibo.face.views.MenuButton#dimensions
* @type {jibo.face.views.Element~DimensionData}
* @readOnly
*/
/**
* Array of 2 colors to be applied to button base. If set to a value of `default`, `confirm`,
* or `cancel` uses the global color for that button type.
* @name jibo.face.views.MenuButton#colors
* @type {number[]}
*/
/**
* Get button data object.
* @method jibo.face.views.MenuButton.getButtonData
* @param {string} type - Type of button.
* @returns {jibo.face.views.MenuButton~ButtonData} ButtonData for the object.
* @protected
*/
/**
* Add button data object.
* @method jibo.face.views.MenuButton.addButtonData
* @param {string} type - Type of button.
* @param {string} assetPath - Path to button timeline src.
* @param {jibo.face.views.Element~DimensionData} dimensions - Width and height of button.
* @param {string} [cache] - Optionally define cache.
* @returns {jibo.face.views.MenuButton~ButtonData} ButtonData for the object.
* @protected
*/
/**
* FOR OVERRIDE ONLY. DO NOT CALL.
*
* Set up the display.
* Assign assets, set timelines, etc.
* @method jibo.face.views.MenuButton#setupDisplay
* @param {Object} [assets] Object passed back from loader namespace load method,
* refer to {@link jibo.loader} for detail.
*/
/**
* Set new icon for MenuButton.
* @method jibo.face.views.MenuButton#setIcon
* @param {PIXI.DisplayObject} icon DisplayObject instance to use as new icon.
*/
/**
* FOR OVERRIDE ONLY. DO NOT CALL EXTERNALLY.
* Define the interactive hit area of the display.
* The DisplayObject.hitArea is what Pixi uses to define the interactive area.
* @method jibo.face.views.MenuButton#setupHitArea
* @param {PIXI.Rectangle} [bounds] Optionally specify the bounds for the hit area.
* If not defined, defaults to using the display's bounds.
*/
/**
* FOR OVERRIDE ONLY. DO NOT CALL.
*
* Destroy.
* @method jibo.face.views.MenuButton#destroy
*/
/**
* Assign colors to display, works for 'Menu' style buttons.
* @method jibo.face.views.MenuButton#applyColors
* @private
*/