Hi there.. i would like to know the exact number for rotating an image.. i thought it's only ranging from 0-360..
2D problems
I haven't used the library yet, but from the documentation - it looks like it probably maps the short int (0 - 65535) as 1 rotation.
Hello Nic-Gun,
The rotation is actually a value between 0 and 4096. This will enable you to rotate with more precision.
To convert a rotation in degrees use this formula: rotation = degrees * 4096 / 360
The rotation is actually a value between 0 and 4096. This will enable you to rotate with more precision.
To convert a rotation in degrees use this formula: rotation = degrees * 4096 / 360
nice.. it spins smoothly now..
okay.. the next problem is, is the maximum bit depth for bmp type files are 8? and why i can't use png type files other than png-24?
also can i blit an image using BltFast() method while using the rotate and scale parameter? because even when i used FLIP_NONE, the image's x and y coordinates changed drastically..
okay.. the next problem is, is the maximum bit depth for bmp type files are 8? and why i can't use png type files other than png-24?
also can i blit an image using BltFast() method while using the rotate and scale parameter? because even when i used FLIP_NONE, the image's x and y coordinates changed drastically..
Edge should be able to load 8-bit and 24-bit uncompressed bitmap files. Also every PNG file format should be supported (we've tested it extensively with the online PNG test suite). If a file isn't able to load properly, can you send it to us?
The rotate and scale parameters aren't available for BltFast(). When using Blt() it takes the center of the image, instead of the topleft (because otherwise it would be very difficult to calculate the position of a rotated image). For example, if the rectangle width is 64 and the rectangle height is 48, add 32 to x and 24 to y to convert them to BltFast() coordinates.
The rotate and scale parameters aren't available for BltFast(). When using Blt() it takes the center of the image, instead of the topleft (because otherwise it would be very difficult to calculate the position of a rotated image). For example, if the rectangle width is 64 and the rectangle height is 48, add 32 to x and 24 to y to convert them to BltFast() coordinates.
okay.. so in term of size, do you prefer bmp or png files? because i realized that bmp files are larger than png files in size, but when put in the EDGE packer, the png files can't be compressed.. but if the bmp files are loaded, then when blitted, will the size affects the performance?
When using the Edge packer, we prefer using 8-bit bitmap files for large backgrounds (converted with photoshop to include dithering), they compress really well in the pack file. For sprites and other graphics it depends on the file to use bitmap or PNG. Because the Edge packer and PNG uses the same compression (ZLib), there is little difference in filesize between the file formats when being packed in an .epk file.
The graphics are uncompressed when they are loaded, it doesn't really matter if you're blitting E2DSurfaces loaded from PNG or bitmap files. It's a good idea to try different formats and see which has the best result regarding filesize and graphics quality.
The graphics are uncompressed when they are loaded, it doesn't really matter if you're blitting E2DSurfaces loaded from PNG or bitmap files. It's a good idea to try different formats and see which has the best result regarding filesize and graphics quality.
I tried using Intersect() on E2DSurface with 2 separate images, but i can't seem to get the image go over the color that's supposed to be the COLOR_KEY.. below is the screenshot i took from my application.

The machine gun bullets from the red plane hit the chopper before they could go through the empty space in front of the chopper. and vice versa, the particle bullets from chopper hit the red plane at the empty space, even though they should have went through even the plane's wing.
I seen your sample Blastar and the intersection went smoothly but it's using only one image.. why i can't do it with 2 images? any suggestions please? and by the way, i forgot to mention that the plane and chopper are png files while the bullets and particles are bmp files..

The machine gun bullets from the red plane hit the chopper before they could go through the empty space in front of the chopper. and vice versa, the particle bullets from chopper hit the red plane at the empty space, even though they should have went through even the plane's wing.
I seen your sample Blastar and the intersection went smoothly but it's using only one image.. why i can't do it with 2 images? any suggestions please? and by the way, i forgot to mention that the plane and chopper are png files while the bullets and particles are bmp files..
It seems like a regular rectangle check, instead of pixel precise collision detection. Did you call E2DSurface::BuildTableMask on every surface (in this case the surface containing the plane and the surface containing the bullets)?
Also remember to call this method after setting the colorkey, otherwise the function doesn't know which pixel has no collision.
Also remember to call this method after setting the colorkey, otherwise the function doesn't know which pixel has no collision.
well, since i used png files, the engine automatically sets the colorkey when loading the image and all i do was blitting the image using EFX_COLORKEY.
must i use BuildTableMask even it's png files? cos i don't know what color the png files use as the colorkey..
must i use BuildTableMask even it's png files? cos i don't know what color the png files use as the colorkey..
Yes, you need to create a mask table for surfaces loaded from PNG files as well. However, you don't need to set the colorkey because it has been set correctly after loading the PNG file.
okay.. done with the pixel collision..
now back to rotate, which direction is the first quadrant (0 - 90 degree), second quadrant (90 - 180), third quadrant (180 - 270) and fourth quadrant (270 - 360)? if i'm not mistaken, the default first quadrant is at upper right and the direction is going clockwise..
now back to rotate, which direction is the first quadrant (0 - 90 degree), second quadrant (90 - 180), third quadrant (180 - 270) and fourth quadrant (270 - 360)? if i'm not mistaken, the default first quadrant is at upper right and the direction is going clockwise..
The rotation is a value between 0 and 4096. To rotate 90 degrees clockwise use the value 1024, 2048 rotates the images 180 degrees and 3072 rotates the image 270 degrees clockwise, or 90 degrees counterclockwise.