Blizzy
me = Scripter.new("Noob")
- 492
- Posts
- 20
- Years
- Age 35
- ~The Netherlands~
- Seen Sep 2, 2007
Creating your own Window.
to create a simple window, you need to have this:
this is a standart window.
now for explaining the lines
make the window to be come a part of Window_Base.
initializes the window.
this creates the window
x, 80
y, 80
width, 480
height, 320.
this is a empty window.
let's put some text in it.
now for explaining the new lines:
this needs to be in every def initialize.
without this, text wouldn't appear.
this "grabs" the font.
this is the size of the font.
this is the color of the text that will be displayed
this means it goes to the method "refresh".
this is a method, which is called by "refresh"
this draws the text on screen. at (4,4,120,32)
This is a small window, with text.
which is boring
so, let's display the hero graphic.
this puts the number of hero's in the letter "i"
this is the x coordinate.
i is the number of hero's that will multiply with 32, and then + 16.
the higher the 32, the more space between the actors.
this is the y coordinate of the actor.
this sets actor equal to $game_party.actors
which are the "heros" in the game.
to call this Window, put the following in a call script:
this is it.
now you guys can start working on your own trainercard.
which is basicly the way.
to create a simple window, you need to have this:
Code:
class My_Window < Window_Base
def initialize
super(80,80,480,320)
end
end
now for explaining the lines
Code:
class My_Window < Window_Base
Code:
def initialize
Code:
super(80,80,480,320)
x, 80
y, 80
width, 480
height, 320.
this is a empty window.
let's put some text in it.
Code:
class My_Window < Window_Base
def initialize
super(80,80,480,320)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.font.color = normal_color
refresh
end #method
def refresh
self.contents.draw_text(4,4,120,32,"Look! Text")
end #method
end #class
Code:
self.contents = bitmap.new(width - 32, height - 32)
without this, text wouldn't appear.
Code:
self.contents.font.name = $fontface
Code:
self.contents.font.size = $fontsize
Code:
self.contents.font.color = normal_color
Code:
refresh
Code:
def refresh
Code:
self.contents.draw_text(4,4,120,32,"Look! Text")
This is a small window, with text.
which is boring
so, let's display the hero graphic.
Code:
class My_Window < Window_Base
def initialize
super(80,80,480,320)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.font.color = normal_color
refresh
end #method
def refresh
self.contents.draw_text(4,4,120,32,"Look! Text")
for i in 0...$game_party.actors.size
x = i * 32 + 4
y = 32
actor = $game_party.actors[i]
draw_actor_graphic(actor,x)
end #for
end #method
end #class
Code:
for i in 0...$game_party.actors.size
Code:
x = i * 32 + 16
i is the number of hero's that will multiply with 32, and then + 16.
the higher the 32, the more space between the actors.
Code:
y = 96
Code:
actor = $game_party.actors[i]
which are the "heros" in the game.
to call this Window, put the following in a call script:
Code:
My_Window.new
now you guys can start working on your own trainercard.
which is basicly the way.