| Author |
Message |
Sercit 99.5% Optimistic

Age:42 Gender: Joined: Sep 12 2003 Posts: 352 Offline
|
Posted: Tue Apr 13, 2004 5:11 pm Post subject: Graphic Files |
 |
|
|
|
Alright, I'll keep this simple. How exactly does the client read the Graphic files? More specifically, Bullet, Warp, wall, etc. _________________ Signature. |
|
| Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3616 Location: Las Vegas Offline
|
Posted: Tue Apr 13, 2004 5:15 pm Post subject: |
 |
|
|
|
| It loads it up, and checks the size of the image (width/height). It then divides those pixel counts by known factors (such as all ships are 10x4) to figure out how wide and tall each frame is. Then, it can read a rectangle at a certain point in the image, and thats what it shows. |
|
| Back to top |
|
 |
Sercit 99.5% Optimistic

Age:42 Gender: Joined: Sep 12 2003 Posts: 352 Offline
|
Posted: Tue Apr 13, 2004 5:17 pm Post subject: |
 |
|
|
|
| hm. *confused* |
|
| Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3616 Location: Las Vegas Offline
|
Posted: Tue Apr 13, 2004 5:24 pm Post subject: |
 |
|
|
|
Look at it this way. Ship1.bm2 is known to be 10 frames wide, and 4 frames tall. Thus, there are 40 ship images on that bitmap.
Continuum looks at the total height/width of the image. Say your ship1.bm2 file is 1000 pixels wide, 80 pixels tall. Continuum then divides by the known factors to get each frame's dimensions. So each frame's width is 1000 / 10 = 100 pixels, and the height is 80 / 4 = 20 pixels.
To get a certain frame, it just looks at multiples of those values. Say it wants frame #13, which is on row 2, column 3. So, the location of that object is at 100*(3-1), 20*(2-1), or 200,20. Thats the upper left corner of the frame. It then draws a little rectangle from that point of the frame size (100,20). So, right know it has the locations [(200,20), (300,40)]. When it wants to draw this to the screen, it just reads that little rectangle in, and thats the image you see on the screen. |
|
| Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Apr 13, 2004 5:41 pm Post subject: |
 |
|
|
|
I would guess that, for example with ships.bm2, it precalcs a RECT rect[40] array with all the bounding boxes. So to draw image #13, you just lookup rect[13] for the source rectangle. _________________ 4,691 irradiated haggis! |
|
| Back to top |
|
 |
Sercit 99.5% Optimistic

Age:42 Gender: Joined: Sep 12 2003 Posts: 352 Offline
|
Posted: Tue Apr 13, 2004 6:00 pm Post subject: |
 |
|
|
|
| Ah, so if I lengthen out the bullet.bm2 file to add a more complex/different bullet animation Continuum will automatically figure out the frames on its own? Or will I have to set it to a certain width? |
|
| Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Apr 13, 2004 6:36 pm Post subject: |
 |
|
|
|
The bullets graphics file has 4x10 frames. As long as your file has 4x10 equal-sized frames, Cont will figure it out. Each frame can be any dimensions, and any proportions.
For example, the default bullets file has 4x10 frames, each 5x5 pixels. You could create a file with 3x7 pixel frames. The resulting image size would be 12x70. |
|
| Back to top |
|
 |
Sercit 99.5% Optimistic

Age:42 Gender: Joined: Sep 12 2003 Posts: 352 Offline
|
Posted: Tue Apr 13, 2004 8:25 pm Post subject: |
 |
|
|
|
Ah, alright. Well now that makes perfect sense. >.o Now If i can just not screw up with this newfound knowledge.  |
|
| Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3616 Location: Las Vegas Offline
|
Posted: Tue Apr 13, 2004 10:16 pm Post subject: |
 |
|
|
|
| You cannot change how many frames are in an animation. Only the size of the outputed animation. So if you want your bullets to be 100x100 images, thats fine, but you cannot change that it only has 4 animation frames. |
|
| Back to top |
|
 |
|