Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Scripting]Window Properties, Basic knowledge about Window~ :)
woratana
post Apr 11 2008, 02:10 AM
Post #1


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




[Basic RGSS/2] Window Properties

By: Woratana
Date: 10/04/2008
Exclusive Article @ RPG RPG Revolution

Hi, this is my first article about RGSS. The basic properties of Window in RGSS and RGSS2 are pretty much the same, so you can use read this article for both RGSS and RGSS2.

Window is the hidden class in RGSS. You can't see the code about how it's made, but you can you use, control it, and make it easier to use by use Window_Base, Window_Selectable, Window_Command etc. Don't worry if you don't understand about Window_Base or Window_Selectable, this article will not focus on those things yet. tongue.gif

This article will help you to learn more about Window's properties. I will just focus on important properties that I usually use. Because I will be able to give good enough description about it. smile.gif

The properties will write on this template:
QUOTE
(Property Name)
Description: (Description from RMVX Help File)
Additional: (My description & Sample Image)
Script: (How to use/change it in script)


[Basic RGSS/2] Window Properties


X
Description: The window's X-coordinate.
Additional: a.k.a. 'Screen X' in event command 'Control Variables...'. For RMXP (RPG Maker XP), it wil goes from 0 (left of the screen) to 640 (right of the screen). For RMVX (RPG Maker VX :3), it will goes from 0 to 544. Take a look at images below for easier understanding. 1 in window's X = 1 pixel.
Script:
CODE
window.x = (integer)

(window in this case is 'the name of variable that hold this window', or use 'self' if using this in its class)


Y
Description: The window's Y-coordinate.
Additional: a.k.a. 'Screen Y' in event command 'Control Variables...'. For RMXP, it will go from 0 (top of the screen) to 480 (bottom end of the screen). For RMVX, it will goes from 0 to 416. Take a look at images below for easier understanding. 1 in window's Y = 1 pixel.
Script:
CODE
window.y = (integer)



RMXP Screen X/Y


RMVX Screen X/Y


Width
Description: The window's width
Additional: Window's width can be in any size you want, but should be at least 33 because of its 'contents' size. (I will explain about contents later) 1 in window's width = 1 pixel.
Script:
CODE
window.width = (integer)



Height
Description: The window's height.
Additional: Same as width, this should be at least 33. 1 in window's height = 1 pixel.
Script:
CODE
window.height = (integer)





Z
Description: The window's Z-coordinate. The larger this value, the closer to the player the plane will be displayed. If multiple objects share the same Z-coordinate, the more recently created object will be displayed closest to the player.
Description(RGSS2): It is no longer possible to use different Z coordinates for the window's background and its contents.
Additional: Basically, window will show above other window if it has more Z


or it's created after the other window.


Script:
CODE
window.z = (integer)



Windowskin
Description: Refers to the bitmap (Bitmap) used as a windowskin
Description(RGSS2): Only RPGVX skins may be used.
Additional: It stores the bitmap that you use for window skin. Different windows can have different skins. RMXP and RMVX is using different style of windowskin.
Script:
CODE
window.windowskin = (Bitmap)





Contents
Description: Refers to the bitmap (Bitmap) used for the window's contents.
Additional: It is the bitmap that create to draw text/images on window. It should have size (width, height) equal to (window's width - 32, window's height - 32). Because if content's size is bigger than that, you will see arrow on the sides of window. And this is why your window width's and height should be at least 33, you will have contents size at least 1 x 1 pixel. (Bitmap size 0 x 0 or negative size is not possible)

Here is the image of default content's size.


In RMVX, Window_Base will automatically create and dispose(clear it from memory) contents for you. But Window_Base in RMXP will only dispose contents for you. You have to create contents by:
CODE
self.contents = Bitmap.new(width - 32, height - 32)



Contents will prevent you from draw text outside window, which will lead to the arrow shows on the side. If you draw text and it's exceed content's size, the text will be cut off, like this:


Script: (Use in its window class only)
CODE
self.contents = Bitmap.new(width - 32, height - 32)

To create bitmap
CODE
self.contents.(method for bitmap, e.g. draw_text, fill_rect)

To control bitmap


Opacity
Description: The window's opacity (0-255). Values out of range are automatically corrected.
Additional: When window's opacity is changed, it will change the window's background and border's opacity. Content's (text/image that draw on window's contents) opacity will not change. 0 is lowest (you can't see window's background and border), 255 is highest.
Script:
CODE
window.opacity = (0 - 255)





Back_Opacity
Description: The window background's opacity (0-255). Values out of range are automatically corrected.
Additional: Similar to Opacity, but this will change only background's opacity, not border.
Script:
CODE
window.back_opacity = (0 - 255)





Contents_Opacity
Description: The opacity of the window's contents (0-255). Values out of range are automatically corrected.
Additional: This will change content's opacity, so it will change the opacity of text and image that draw on window's contents.
Script:
CODE
window.contents_opacity = (0 - 255)





Visible
Description: The window's visibility. If TRUE, the window is visible.
Additional: This is one of the useful properties when making HUD or Menu. Window will show if visible is true, and hide if visible is false.
Script: window.visible = (true/false)


==========================================
Some of properties that I didn't put in this article can be found in RMXP/VX help file (press F1 in program), search by keyword 'Window'.

If you have any question or suggestion about this article, feels free to post. I'll glad to hear(read) it. smile.gif

Thanks!


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
YanXie
post Apr 11 2008, 03:09 AM
Post #2


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Good job Wora :3 ,I hope with this guide,there will be less request for non-sensical scripts after this tongue.gif

Too bad I won't do anything about the syntax list until I finish the storage script tongue.gif

cheers,puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
ERZENGEL
post Apr 11 2008, 03:48 AM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 127
Type: None
RM Skill: Undisclosed




That's a great tutorial for modifying windows, woratana!
Go to the top of the page
 
+Quote Post
   
woratana
post Apr 11 2008, 10:06 AM
Post #4


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




Thanks for reading this! puppeto and Erzengel.

Let me know if there's any article/tutorial you want me to write about smile.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Holder
post Apr 11 2008, 11:28 AM
Post #5


Spoilers.
Group Icon

Group: Revolutionary
Posts: 4,203
Type: Developer
RM Skill: Advanced
Rev Points: 250




This is great, I love to see things like this. From what you've covered here you've put alot of effort into it and with picture examples (always useful thumbsup.gif ).

Is this a first in a long run of Articles? If it is so then I hope you can continue past where most stop, it's normally past the variables and conditional statements part.

Just as a suggestion woratana, I would enjoy seeing how complete scripts come together - meaning as a tutorial, what you're using(code wise) and what it does to the final result.


__________________________

 I'm running the Great North Run in September in aid of NACC. A condition my wife has in it's severe form.
Please sponsor me with whatever you can, thank you.
If you'd like to help spread the word please share the image and link to my fundraising page.

Go to the top of the page
 
+Quote Post
   
Shichoku
post Apr 11 2008, 08:06 PM
Post #6


Level 4
Group Icon

Group: Member
Posts: 55
Type: None
RM Skill: Skilled




Thanks for the excellent tutorial, Wora, and for the help that you provided me with the other day. :3
Go to the top of the page
 
+Quote Post
   
lahandi
post Apr 19 2008, 11:03 AM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Artist
RM Skill: Skilled




QUOTE
Let me know if there's any article/tutorial you want me to write about


Can you tell me how to create some set of windows that can be called an closed when the player pressing certain button?

Thank you. smile.gif


__________________________
Go to the top of the page
 
+Quote Post
   
YanXie
post Apr 19 2008, 11:36 AM
Post #8


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




If you mean call and close window,and not write the window script,then you can easily do that by common event smile.gif

Look at screenshot below :



cheers,puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
barkot
post Apr 22 2008, 01:06 AM
Post #9


Level 3
Group Icon

Group: Member
Posts: 33
Type: Musician
RM Skill: Beginner




w00t!
Thanks Woratana-kun! biggrin.gif
This tut helped a lot biggrin.gif

yours,
Bark =]

This post has been edited by barkot: Apr 22 2008, 01:11 AM
Go to the top of the page
 
+Quote Post
   
Rukiri
post Apr 22 2008, 06:44 PM
Post #10


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,717
Type: Scripter
RM Skill: Advanced




Thanks man, This is gonna help for my custom Menu system I plan on doing, also how is RGSS2 different from ruby and RGSS1?


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
woratana
post Apr 22 2008, 07:10 PM
Post #11


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




@Mystic

Not really different, tongue.gif

There're one article in RRR main site that talk about this though,
but I can't get you the link because I can't enter main site now.


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
semajames
post Apr 25 2008, 01:34 AM
Post #12


Level 10
Group Icon

Group: Revolutionary
Posts: 164
Type: Event Designer
RM Skill: Advanced




Hey wora, great script. Could you post a tutorial clearly defining the differences between RGSS and RGSS2. I'm trying to learn scripting and have found some good tutorials for RGSS, but I'm running VX, so I'm getting a bit confused as to the difference between the 2. RMVX's help file doesn't clearly tell me, and I havn't found a good tutorial for this either. I'd appreciate the help.


__________________________
I hereby challenge you all to beat me!
http://www.rpgrevolution.com/forums/index....e=play&g=23
Good luck!
Go to the top of the page
 
+Quote Post
   
GaijinSama
post May 22 2008, 12:05 AM
Post #13



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Skilled




Exacly what I was looking for! Thanks so much!
Go to the top of the page
 
+Quote Post
   
carbajosa
post Aug 29 2008, 11:17 PM
Post #14


Level 4
Group Icon

Group: Member
Posts: 49
Type: None
RM Skill: Undisclosed




I have made my window script but I have no Idea how to call it on event. Can someone teach me?
Go to the top of the page
 
+Quote Post
   
Leventhan
post Aug 30 2008, 02:59 AM
Post #15


<member title here>
Group Icon

Group: Revolutionary
Posts: 113
Type: None
RM Skill: Undisclosed




Excellent tutorial. =)


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 04:57 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker