My First plugin! ... Not working... ._.'

I decided to post here because I'm having an issue with a plugin I'm trying to work and for the life of me I can't figure out how to get it to work, I've changed and fixed many things but nothing seems to work.

I'm trying to make a simple plugin which will allow me to edit some parameters of the draw title function. So I can do things like change the outline color, where it's positioned, etc. The title just completely disappears though, which is definitely not what I'm looking for. 😅

Here is the whole plugin, decided to let you see all the parameter setups too in case I messed up somewhere.
Spoiler: Smash Artist's Derpy Non-functional First Plugin
Code:
/*:
 * @plugindesc This is  the plugin description!
 * This is my first actual plugin! It will probably suck tho. XD
 * @author SmashArtist
 *
 * @param This is a param title!
 * @type this is the param type ex: music , img , stuff
 * @desc This is the parameter description
 * @default default the param is set to
 *
 * @param xpos
 * @text X Position
 * @type Number
 * @desc The x position of the title.
 * Default: 20
 * @default 20
 *
 * @param ypos
 * @text Y Position
 * @type Text
 * @desc The y position of the title.
 * Default: Graphics.height / 4
 * @default Graphics.height / 4
 *
 * @param outline_c
 * @text Outline Color
 * @type Text
 * @desc The outline color of the title.
 * Default: black
 * @default black
 *
 * @param outline_w
 * @text Outline Width
 * @type Number
 * @desc The outline width of the title.
 * Default: 8
 * @default 8
 *
 * @help
 * Everything after the help sign will be the help file for the plugin!
 * ....
 * .............
 * Until the asterix and the slash, then it's all the coding shizzles.
 *
 * This is the end of the help file! Bye bye! (~ 'v')~
 * =================================================================================
 *                                   ~~CHANGELOG~~
 * =================================================================================
 * Ver 1.1 - Made some derpy title draw code editing.
 * Ver 1.0 - Plugin made! So far the plugin does nothing, but I will add code later!
 * =================================================================================
 */

(function() {

    var parameters = PluginManager.parameters('SA_FirstPlugin');
    var parameter0 = String(parameters['This is a param title!']);
    var xpos = Number(parameters['xpos']);
    var ypos = String(parameters['ypos']);
    var outline_c = String(parameters['outline_c']);
    var outline_w = Number(parameters['outline_w']);

        Scene_Title.prototype.drawGameTitle = function() {
         var x = xpos;
         var y = ypos;
         var maxWidth = Graphics.width - x * 2;
         var text = $dataSystem.gameTitle;
         this._gameTitleSprite.bitmap.outlineColor = outline_c;
         this._gameTitleSprite.bitmap.outlineWidth = outline_w;
         this._gameTitleSprite.bitmap.fontSize = 72;
         this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');
        };

})();

If anyone can help me figure out what's wrong I would be most appreciative! I really hope I can get better at this! :kaomad2:
Try setting ypos to a number (e.g. 0) in the plugin's settings. ^_^

It turns out that the xpos parameter is mostly redundant here, since the drawText method is called with 'center' alignment. You can replace the 'center' with 'left' or 'right' to change the alignment. You could even add another parameter and use that! Try out the select type, it's great for stuff like this. Here's the help thread on parameter types if you don't already have it bookmarked: link. 😂

Lastly: the ypos parameter should be a number type, like xpos. You've made it text, though, which the game finds confusing. There is a way to allow a formula like 'Graphics.height / 4' for a parameter, though! If you'd like to try, then make both xpos and ypos text type parameters and change this line:
Code:
var xpos = Number(parameters['xpos']);
...to this:
Code:
var xpos = String(parameters['xpos']);
Then change these two lines:
Code:
var x = xpos;
var y = ypos;
...to this:
Code:
var x = eval(xpos);
var y = eval(ypos);
This tells the code to evaluate the xpos and ypos strings as if they were code. It's very powerful, but try to use it sparingly. 😅
Wow thanks so much for your help! I finally got it working, seems it was drawing the title offscreen or something, changing the ypos to a number instead of code fixed it! 👋
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/my-first-plugin-not-working-_.92044/