hey there banisher, first ill explain a little about what the .new means, basically when you have a class and you want to use it, it must be created, to do this we assign it to a variable that we can use, so for example:
that creates the class we want to use and can be used with the variable name.
so next in this case we are using the Sprite class, which is used for drawing images to, to actually make the sprite have graphics we use its bitmap, just think of that as the paper you draw too, we can create a blank bitmap that we can add drawings to, or we can create a bitmap that already has graphics, I use xp but I think the classes are pretty similar, to make a sprites bitmap have graphics we would do this:
sprite = Sprite.new
sprite.bitmap = Bitmap.new(GRAPHICS_NAME_INCLUDING_DIRECTORY)
#so if I wanted to use an image called image in the directory graphics:
sprite.bitmap = Bitmap.new("graphics//image")
to create a blank bitmap we add drawings to we would do this:
sprite = Sprite.new
sprite.bitmap = Bitmap.new(WIDTH, HEIGHT)
#to actually draw to our blank bitmap we use other bitmap objects,
#so to draw an image to our blank bitmap
bitmap2 = Bitmap.new("image")
sprite.bitmap.blt(X, Y, bitmap2, RECT)
what happens there is pretty self explanatory, you define the x and y location the image will be drawn on the bitmap, then you tell it what image its going to draw, then you define a the rectangle area of the source image its going to draw, the rect is this:
Rect.new(X, Y, WIDTH, HEIGHT)
the rect is used to only draw part of an image, and is very useful for that as its used to animate characters ect, but if you want to draw the whole image you still have to define a rect area, so here is a couple of examples of us using the rect:
#blah blah we've already created our sprite and bitmap
#the following example will draw our second bitmap on our first bitmap at the x of 0 and the y of 0,
#it will also draw the whole bitmap defined by the rect
sprite.bitmap.blt(0, 0, bitmap2, Rect.new(0, 0, bitmap2.width, bitmap2.height))
#an example of the rects parameters
Rect.new(X1, Y1, X2, Y2)
#X1 & Y1 are the start locations and X2 & Y2 are the end locations for the area coppied,
# so for the whole bitmap we start at 0 and end at its width/height
#this would just copy the given area:
sprite.bitmap.blt(0, 0, bitmap2, Rect.new(40, 40, 80, 80))
#so the area drawn to the bitmap would start at 40pixles and end at 80 for both x&y,
# drawing a 40x40 square area of the bitmap
so that's an overview of how the drawing works, I think iv been pretty clear so I hope this helps