I am very confused, when I look at some of the graphics files, accompanied with
some games.
When you look inside them, there are a lot of "frames" or what they are called.
This picture could fx. be an explosion...in the first frame, the explosion is beginning, in
the next frame it's getting bigger etc...
How is it possible to choose, which frames you want to display???
I have attached a picture.
That's series of animation sequences. This one is two dimensional.
to perform animations of 1d sequences, you loop trough x by adding width. for 2d sequences you loop trough y and x nested inside y loop, which increase y by height.
to select a sequence by index for 1d: x=i*width
and for 2d: x=(i mod xseq)*width: y=(i\xseq)*height
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
no it's not btw, it's better to use 1d sequences, for both memory usage (sometimes) and performance, and they are easier to use.
x=i*width
i think you can handle that
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
nope, you need to blit it somewhere, X is asigned the x coordinate on the source bitmap i guess you know how to use bitblt?
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
you need this declaration to use bitblt. You pass handles of source and destination DC's, you'll find them as properties of any picturebox or form. You have to pass target coordinates, source coordinates, and also the size of area to be copied. With dwrop you specify the bitcomparation performed between source and target bits, you can find them in vb help files, usually you just use vbsrccopy which just replaces the target with the source.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
nothing is too advanced once you get used, you'll see it's very simple.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
depens if you are more used to DX than win32api, blt and bltfast are pretty similar to bitblt, except that you don't have the comparation flags.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
This will show you the basics of bitblt, doing flickerless redraw, and using inverted masks (to use colours or textures in a certain shape). It's about that because I had a request...
And for your frames, since there is "padding" (an amount of pixels to the left and the top before the data starts) it will be hard to animate. It's better if there is no padding. If you have, say, a 10x20 image, you can create two 10x10 frames.
The first one starts at 0,0 and goes to 9,9. So since you dont need to call the right and top properties for BitBlt, you can call these:
Frame - The animation frame you are currently on.
X - The start-X to blit from.
Y - The start-Y to blit from.
MaxFrames - A constant holding how many frames in the BMP; in this case, it will be two.
Code:
Frame = Frame + 1 Mod MaxFrames
X = 0
Y = 10 * (Frame - 1)
This is all there is to it. If you wanted it to be 20x10 instead of 10x20, you could simply switch the X and Y constants. Using this you now have the X and Y for the BitBlt subroutine. The Width and Height will always be 10. You can find out how many frames there are in a bmp if you have:
Width and Height of Frame
Width and Height of BMP
Then you divide the BMP width by the Frame Width and the BMP Height by the frame height. Then multiply the two products together to get your end product, the number of frames, which you can then store in MaxFrames:
Code:
MaxFrames = int(Bwid / Fwid)* int(Bhei / Fhei)
This works by:
Making sure a whole number is made out of the two. The width is 10 and the frame height is 10, making the rounded product 1. The height is 20 and the frame height is 10, making the final, rounded product 2. The final multiplication will tell you how many frames there are: 1 x 2. This equals two, and you have two frames!
Hope you appreciate this!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
(Just a heads-up)
sCopy? LOL real programmers don't do functions to wrap bitblt
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
LOL I ain't a normal programmer... besides, what normal programmer writes games in vb...?
And yes I love to wrap things its so fun. Evidently you don't understand that it also keeps arrays of rectangles and source bitmaps to get Characters and Items and Scenery and Tiles and copy them just with the "tileset", the "tile number" and the "frame".
So there.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
(Just a heads-up)