Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualEarthBanana

Posted 31 March 2013 - 01:52 AM

The common way to do this is to use a sprite sheet image - this is just one single image with all three ghost faces on it. You then choose which image to draw by drawing different coords of the image...

 

for example if the total image is 192 by 64 - and each ghost is 64 by 64 - you can draw the first ghost by drawing (0,0,64,64) part of the image where the arguements are (startXPixel,startYPixel,width,height) and then draw the next with (64,0,64,64) and the last with (128,0,64,64).

 

I know you said it is not a sprite sheet but I don't see any reason why not to do it as such - you will learn this concept which is pretty importatn in making 2d games..


#2EarthBanana

Posted 31 March 2013 - 01:49 AM

The common way to do this is to use a sprite sheet image - this is just one single image with all three ghost faces on it. You then choose which image to draw by drawing different coords of the image...

 

for example if the total image is 192 by 64 - and each ghost is 64 by 64 - you can draw the first ghost by drawing (0,0,64,64) part of the image where the arguements are (startXPixel,startYPixel,width,height) and then draw the next with (64,0,64,64) and the last with (128,0,64,64).


#1EarthBanana

Posted 31 March 2013 - 01:48 AM

The common way to do this is to use a sprite sheet image - this is just one single image with all three ghost faces on it. You then choose which image to draw by drawing different coords of the image...

 

for example if the total image is 192 by 64 - and each ghost is 64 by 64 - you can draw the first image by drawing (0,0,64,64) part of the image where the arguements are (startXPixel,startYPixel,width,height) and then draw the next with (64,0,64,64) and the last with (128,0,64,64).


PARTNERS