daily pastebin goal
15%
SHARE
TWEET

CustomTextOnTitleScreen

Ellye Nov 5th, 2015 (edited) 1,832 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Place file inside /js/plugins
  2. // Remember to save after adding plugins or changing parameters.
  3. // Made by request.
  4. //=============================================================================
  5. // Custom Text on Title Screen
  6. //=============================================================================
  7. /*:
  8.  * Version: 2015-11-06-0008
  9.  *
  10.  * CHANGE LOG:
  11.  * 2015-11-06-0008 - Released.
  12.  *
  13.  *
  14.  * @plugindesc Ver.2015-11-06-0008. Displays a custom text on title screen.
  15.  * <Ellye Title Text>
  16.  * @author https://ellyeblog.wordpress.com/ || http://steamcommunity.com/id/Ellye
  17.  *
  18.  * @param Text
  19.  * @desc The text to display
  20.  * @default Version1.0
  21.  *
  22.  * @param h_align
  23.  * @desc 0: Left. 1: Center. 2: Right.
  24.  * @default 2
  25.  *
  26.  * @param v_align
  27.  * @desc 0: Top. 1: Center. 2: Bottom.
  28.  * @default 2
  29.  *
  30.  * @param X Offset
  31.  * @desc The X offset for the text.
  32.  * @default 0
  33.  *
  34.  * @param Y Offset
  35.  * @desc The Y offset for the text.
  36.  * @default 0
  37.  *
  38.  * @param Outline Color
  39.  * @desc Color of the text outline
  40.  * @default #000000
  41.  *
  42.  * @param Outline Width
  43.  * @desc Width of the outline
  44.  * @default 3
  45.  *
  46.  * @param Font Size
  47.  * @desc Size of the font
  48.  * @default 27
  49.  *
  50.  * @param Text Color
  51.  * @desc Color of the text
  52.  * @default #FFFFFF
  53.  *
  54.  * @help This plugin displays a single string on your title screen. For showing the game version, for example.
  55.  *
  56.  */
  57.  
  58. (function() {
  59.     var parameters = $plugins.filter(function(p) {
  60.         return p.description.contains('<Ellye Title Text>');
  61.     })[0].parameters; //Thanks to Iavra
  62.  
  63.  
  64.     var custom_text = String(parameters['Text'] || "");
  65.     var h_align = Number(parameters['h_align'] || 2);
  66.     var v_align = Number(parameters['v_align'] || 2);
  67.     var x_offset = Number(parameters['X Offset'] || 0);
  68.     var y_offset = Number(parameters['Y Offset'] || 0);
  69.     var outline_color = String(parameters['Outline Color'] || "#000000");
  70.     var outline_width = Number(parameters['Outline Width'] || 2);
  71.     var font_size = Number(parameters['Font Size'] || 18);
  72.     var text_color = String(parameters['Text Color'] || "#FFFFFF");
  73.  
  74.  
  75.     _alias_scene_title_create_ = Scene_Title.prototype.create;
  76.     Scene_Title.prototype.create = function()
  77.     {
  78.         _alias_scene_title_create_.call(this);
  79.         this.DisplayCustomText();
  80.     };
  81.  
  82.     Scene_Title.prototype.DisplayCustomText = function()
  83.     {
  84.         this._titleCustomText = new Sprite(new Bitmap(Graphics.width, Graphics.height));
  85.         this.addChild(this._titleCustomText);
  86.         var y = VerticalPosition() + y_offset;
  87.         var maxWidth = Graphics.width - x_offset * 2;
  88.         var text = custom_text;
  89.         this._titleCustomText.bitmap.outlineColor = outline_color;
  90.         this._titleCustomText.bitmap.outlineWidth = outline_width;
  91.         this._titleCustomText.bitmap.fontSize = font_size;
  92.         this._titleCustomText.bitmap.textColor = text_color;
  93.         this._titleCustomText.bitmap.drawText(text, x_offset, y, maxWidth, font_size, HorizontalAlignment());
  94.     };
  95.  
  96.     VerticalPosition = function()
  97.     {
  98.         switch (v_align)
  99.         {
  100.             case 0:
  101.                 return 0;
  102.             case 1:
  103.                 return Graphics.height / 2 - font_size / 2;
  104.             default:
  105.                 return Graphics.height - font_size;
  106.         }
  107.     };
  108.  
  109.     HorizontalAlignment = function()
  110.     {
  111.         switch (h_align)
  112.         {
  113.             case 0:
  114.                 return 'left';
  115.             case 1:
  116.                 return 'center';
  117.             default:
  118.                 return 'right';
  119.         }
  120.     };
  121.  
  122. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top