Draw a window

Good Morning!
I'm trying to draw a window, with text, but I'm having a lot of problems, and I can't solve it, could someone
help me? Please.
.
my current code is this.

.
var win = new Rectangle(100, 100, 500, 100);

SceneManager._Scene.addChild(win);
$gameTemp._addedWindows = $gameTemp._addedWindows || [win];
$gameTemp._addedWindows.push(win);
win.setBackgroundType(1); win.drawTextEx("text here", 0, 0);

Original thread: https://forums.rpgmakerweb.com/threads/draw-a-window.125720/