Sprite image size
Blitz3D Forums/Blitz3D Beginners Area/Sprite image size
| ||
Sorry if this has been asked before: Does a sprite image size have to be to the power of 2 i.e. 256x256, 512x512 etc or can it be of any size and displayed correctly (same ratio as image)? Kind Regards, Gamzman |
| ||
As far as I know it can be any size. |
| ||
"As far as I know it can be any size. " Thats what I figured, but when I load a sprite thats 800x600 it gets displayed as a square when within the image its a rectangle. I think blitz is resizing my image. |
| ||
Are you talking 3D sprites? If yes, You'll need to ScaleSprite to match the aspect ratio of your image (1.33:1) Also, it's much safer to keep image sizes in a power of two, as some video cards with struggle or fail if they're not. |
| ||
3D sprites? umm not sure, im using the LoadSprite(File$) command so I assume so. "If yes, You'll need to ScaleSprite to match the aspect ratio of your image (1.33:1)" ok sounds good, one more thing at the risk of sounding stupid but, when you scale a sprite thats already 256x256 and scale it by 4,4 does that mean the size is now 4*256,4*256,1 or is an absolute size |
| ||
When you create or load a sprite in blitz3d it is of size 2x2 with opposite corners being at "-1,-1" to "+1,+1". The size of the image you use (and it really should be a power of 2 as said above) is unrelated to the size of the sprite in the 3d world. When you scale a sprite the image size does not change, only the size of the sprite. Think of the sprite as a 3d object which is rectangular in shape, but with no depth. |
| ||
thank you matty :) |