|
|||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||
SAMUS'S TUTORIAL PAGE |
|||||||||||||||||||||||||
|
MAIN BACKGROUND DEFINITION This is the part of the DEF file where the each background element is defined. Each element has it's own image, velocity, starting positions, etc... etc... etc... Every element must start off with, [BG x] Where 'x' is a number or word or your choice, which is only for your records to keep track of, incase there is an error in that element, MUGEN would let you know. And element consists of parameters, which I will go over in detail. type = parameter This parameter defines what kind of image will this element be. There are 3 different types: normal - This is just a flat normal image. parallax - This gives the image a 3D look by scrolling the image. Sort of like the floors in Street Fighter 2. anim - This declares the image to be an animation. spriteno = group no, image no This assigns the element an image. The syntax is, spriteno = group number, index number. Make sure you remember what group and index numbers you assigned each image in your SPRMAKER text file. start = x, y This is the starting position of the image based on the top right of the image. x is relative to the center of the stage, which would be directly in between the starting position of the characters. If you want the image to start at the leftmost portion of your stage, it must be a negative number. Or if you want the image to start to the right of the characters you must us a positive number. y is relative to the top of the screen when you start the stage. This number should be around (if not the same) number as 'boundhigh', to be sure that when a character jumps there will still be a background. So you may need to move around these numbers until you get it just right. Also this must be an integer, no decimal places. delta x, y The delta is how fast the background element moves, when the camera pans. This number could be a float, or can have a decimal. A value of 1, moves the background exactly 1 pixel for every 1 camera unit moved. (So if the camera moves over 1 unit the background moves over 1 pixel, get it!?) If the value is bigger than 1, the background will scroll faster, or if the value is smaller than one, the background will scroll slower. Again you must change these values until you get your desired feel for the scrolling. trans = parameter This is to change the transparency of the image if desired. There are 4 types of parameters, they are: none - Does not make any kind of transparency, this is the default if 'trans' is omitted. add - Makes the image brighter. add1 - I suppose it makes the image brighter than 'add' but I cannot tell the difference. sub - Makes the image darker. mask = flag This flag can hide the color '0' of your palette, so that you can see through the color '0'. This is why we prepped the images in step 2. For the flag, '0' turns masking off, meaning the background will look exactly like it is, this is the default if 'mask' is omitted. A '1' will turn masking on and will not draw the color '0'. This is good when you want to have multiple backgrounds. layerno = parameter This will determine whether the image is drawn in front of the character or in back of the character. If you the image drawn in back of the character, (which you normally do, this being a 'background' and all) use a '0', also this is the default if 'layerno' is omitted. If you want the image drawn in front of the character, you must use a '1'. velocity = x, y This is the speed the background moves at. The value you use is how many pixels the image moves at per game tick. This number can be a float, or can have a decimal. The default number is '0' if 'velocity' is omitted. tile = x, y This will continuously place the image right next to the image, therefore 'tile'ing the image. If you want to tile the image from left to right infinitely, at the x parameter use '1'. Or if you want to tile the image up and down infinitely, at the y parameter use '1'. Or if you only want to image to be tiled a certain number of times, instead of '1', just place that certain number in the parameter instead. The default is '0' if 'tile' or one of the parameters is omitted. tilespacing = parameter This parameter is an integer number, meaning no decimals, of how many pixels to draw between tiles. If omitted than the image tiles 'back to back'. sin.x = length,time This option makes the image circle back and forth on the x axis continuously, or left to right. length is the number of pixels of the radius, and time is the game ticks that it takes to complete one rotation. sin.y = length,time This option makes the image circle back and forth on the y axis continuously, or up and down. length is the number of pixels of the radius, and time is the game ticks that it takes to complete one rotation. So an example of a background element would look like this: [BG TheFloor] type = normal spriteno = 1,0 start = -150, 180 delta = .8, .75 mask = 1 As you see you only define what you have to. You only implement what you need to be changed from the default. Just keep in mind, for every image set that you have, you have to create a background element. And if there is an element above this one... that sprite will be drawn behind this image. And if there is an element below this one... that sprite will be drawn in front of this image. See how that works!? After you have fiddled and toyed and have been the anal retentive perfectionist you know you are, to make sure these backgrounds look initially how you like it, you're ready to move on to more advanced background definitions. | |||||||||||||||||||||||||