Description
Allows to display generic popups messages on the screen.
Author
Iavra
Parameters
@param Display On Scene
@desc A comma-separated list of scenes where popups are allowed.
@default Scene_Map, Scene_Menu
How to Use
To display a new popup, call the following function:
IAVRA.POPUP.popup(text, options, callbacks);
Where "text" is the text to be displayed, "options" is an optional object to override some or all of the default options and "callbacks" is an optional object to override some or all of the default callbacks. Any escape characters can be used inside the "text" parameter, but most will need to have their backslashes doubled.
The following options can be specified:
width
Width of the popup window. It's height will be autofit to its content. Default: 200
duration
How long the popup should be visible. The update callback can choose to ignore this value. Default: 100
lineHeight
Overwrite lineHeight() in Window_Base, use default if empty. Default: (empty)
fontName
Overwrite standardFontFace() in Window_Base, use default if empty. Default: (empty)
fontSize
Overwrite standardFontSize() in Window_Base, use default if empty. Default: (empty)
padding
Overwrite standardPadding() in Window_Base, use default if empty. Default: (empty)
textPadding
Overwrite textPadding() in Window_Base, use default if empty. Default: (empty)
backOpacity
Overwrite standardBackOpacity() in Window_Base, use default if empty. Default: (empty)
windowskin
Overwrite loadWindowskin() in Window_Base, use default if empty. Default: (empty)
scenes
Takes an array of scene classes and overwrites the value specified in "Display On Scene".
The following callbacks can be specified:
init(popup)
Called after the popup has been created, but before text has been drawn on it.
update(popup)
Called every frame. If this function returns a falsy value, the popup is removed. It has access to the popup duration and can either work with or ignore it.
remove(popup) Called when the popup is removed either by running out, clear() or because update() returned false.
To clear all popups, call the following function:
IAVRA.POPUP.clear();
Terms of Use
Free to use for both commercial and non-commercial games. Please give credit.
Download
http://pastebin.com/a9FERYYT
Notes
This plugin doesn't do much on its own, but is meant as a framework for other plugins and might be needed as a dependency for some of mine.
本贴来自国际rpgmaker官方论坛作者:Iavra处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/iavra-generic-popup.47223/