Blizzy
me = Scripter.new("Noob")
- 492
- Posts
- 20
- Years
- Age 35
- ~The Netherlands~
- Seen Sep 2, 2007
ok, i've made another toturial:
read it carefully...
RGSS Toturial [Basics]
● Drawing a picture on screen:
You can give @image any other name you could think of,
but it needs to start with @.
This will draw a picture at x 0 and y 0,
To set the co?rdinates of the x & y: (you can use any number)
To set a layer, use:
to move pictures, use .ox and .oy
example:
● Drawing text on Screen
To draw text, you'll need to have the following in "def initialize"
If you don't have this in the method, no text will be draw on screen.
to set text, use the following line:
x is the x-co?rdinate of the text
y is the y-co?rdinate of the text
width is the lengt of the text
height is the height of the text
the width & height is the same as the size of the font!
example:
"this is text", if width is "8"
it'll display something like this:
"this i" and the rest is invisible
● Switches
to modify switches, you*ll need to do:
ID is the number of the switch
flag value is: true or false (on/off)
● Variables
to modify variables:
ID is the number of the variable
you can do the following with variable:
set equal: =
add : +=
substract: -=
multiply : *=
divide : /=
there are more, but the're not hard to find
you can also store text in variables!
example:
to test it, use this in a call script:
● Local_Switches
to modify local_switches:
MapID is the ID of the map
ID is the event ID
"Local-Switch" is "a,b,c or d"
flag value is true or false
after each local switch modify, you'll need to refresh the map:
this is it for now.
i might do some more toturials about rgss.
if you have any ideas for next toturials plz post them.
comments & questions are welcome
read it carefully...
RGSS Toturial [Basics]
● Drawing a picture on screen:
Code:
@image = Sprite.new
@imate.bitmap = RPG::Cache.picture("name of picture")
but it needs to start with @.
This will draw a picture at x 0 and y 0,
To set the co?rdinates of the x & y: (you can use any number)
Code:
@image.x = 100
@image.y = 100
Code:
@image.z = 100 # 1 - 9999+.
example:
Code:
@image.ox += 1 or -= 1
@image.oy += 1 or -= 1
● Drawing text on Screen
To draw text, you'll need to have the following in "def initialize"
Code:
self.contents = Bitmap.new(width - 32, height - 32)
to set text, use the following line:
Code:
self.contents.draw_text(x,y,width,height, "text")
y is the y-co?rdinate of the text
width is the lengt of the text
height is the height of the text
the width & height is the same as the size of the font!
example:
"this is text", if width is "8"
it'll display something like this:
"this i" and the rest is invisible
● Switches
to modify switches, you*ll need to do:
Code:
$game_switches[ID] = flag value
flag value is: true or false (on/off)
● Variables
to modify variables:
Code:
$game_variables[ID] = number
you can do the following with variable:
set equal: =
add : +=
substract: -=
multiply : *=
divide : /=
there are more, but the're not hard to find
you can also store text in variables!
example:
Code:
$game_variables[1] = "look! text"
Code:
print $game_variables[1].to_s
● Local_Switches
to modify local_switches:
Code:
$game_self_switches = {[MapID, EventID, "LOCAL-SWITCH"] => flag value}
$game_map.need_refresh = true
MapID is the ID of the map
ID is the event ID
"Local-Switch" is "a,b,c or d"
flag value is true or false
after each local switch modify, you'll need to refresh the map:
Code:
$game_map.need_refresh = true
this is it for now.
i might do some more toturials about rgss.
if you have any ideas for next toturials plz post them.
comments & questions are welcome
Last edited: