ok, i've made another toturial:
read it carefully...
RGSS Toturial [Basics]
● Drawing a picture on screen:
@image = Sprite.new
@imate.bitmap = RPG::Cache.picture("name of picture") 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 cordinates of the x & y: (you can use any number)
@image.x = 100
@image.y = 100
To set a layer, use:
@image.z = 100 # 1 - 9999+.
to move pictures, use .ox and .oy
example:
@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"
self.contents = Bitmap.new(width - 32, height - 32)
If you don't have this in the method, no text will be draw on screen.
to set text, use the following line:
self.contents.draw_text(x,y,width,height, "text")
x is the x-cordinate of the text
y is the y-cordinate 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:
$game_switches[ID] = flag value
ID is the number of the switch
flag value is: true or false (on/off)
● Variables
to modify variables:
$game_variables[ID] = number
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:
$game_variables[1] = "look! text"
to test it, use this in a call script:
print $game_variables[1].to_s
● Local_Switches
to modify local_switches:
$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:
$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