Gw Temp

Menu

Tutorial - 'Custom Mwin' by guy

An item about RPG Toolkit posted on

Blurb

A tutorial covering how to make a custom message system in RPG Toolkit.

Body

So you are probly thinking, hey it's too much trouble to make a custom message window, i'll just stick to the default. Sure you can. But you can do LOADS of extra stuff with a custom mwin. You can move them where ever you want, you can add profile images easily, you can make them any size, you could even change the mwin box at anytime.

Well it sounds okay but its too hard to learn how to do. This isn't true. You need very VERY little rpgcode experince. And even if you don't have any idea about something, don't worry. I will be explaining each command along the way. Sure your first couple might not be so great, take mine for example. Every line moved further to the right. So enough with this idle chit chat. ON WITH THE TUTORIAL!

Ok, So the first thing you do is create a method and call it whatever you want. It should look like.

#method yourmwin(varibles go here)
{
}

Don't Worry about the part that says "Varibles go here" We won't use that until later. Now between the { } put #savescreen(). Now the next line should be #setimage(mwingph.w/e, x!, y!, Yourwidth, yourhight}.

Obviously where i put yourwidth and yourhiegh youput the width and hieght of you mwin image.

Now for the tricky part. Now remember where i put varibles go here? well delete that and type line1$, line2$, line3$, x!, y!, and mwingph.w/e$

Your Mwin code should look like this

#method yourmwin(line1$, line2$, line3$, x!, y!, mwingph.w/e$)
{
#savescreen()
#setimage(mwingph.w/e$, x!, y!)
}

Now we will want to move the writing over alittle so you can ready it so type y!=y!+2. Y is the posistion of the mwin on the screen. X also works the same way, but don't type x!=X!+1, trust me on this one. Now I won't go over the next part because you can understand it yourself. So your code will look like this:

#method TFTmwin(y!, line1$, line2$, line3$,)
{
#savescreen()
#setimage(y!, blobmwin.gif)
#y!=y!+2
#text(2, y!, line1$)
#y!=y!+2
#text(2, y!, line2$)
#y!=y!+2
#text(2, y!, line3$)
}

Now we will do a while loop to prevent the player from closing the window with any button:

#method TFTmwin(y!, line1$, line2$, line3$,)
{
#savescreen()
#setimage(y!, blobmwin.gif)
#y!=y!+2
#text(2, y!, line1$)
#y!=y!+2
#text(2, y!, line2$)
#y!=y!+2
#text(2, y!, line3$)
#while(enter_press!=0)
{
#wait(enter$)
#if(enter$="ENTER")
{
#restorescreen()
#Enter_press!=1
}
}
}

And there you have it, a custom mwin. Remember that this mwin has no special features or anything and is ment to give you a firm grasp on creating your own.