Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprite Switch?

Author
Message
Kira
16
Years of Service
User Offline
Joined: 25th Jan 2008
Location:
Posted: 31st Mar 2008 21:02
i have this new problem regarding about sprites again. let's say i have a picture with letters A-E in a row and in a single column, how would i manipulate this picture in DarkGDK.

now, i want only the letter A to be showing on the screen and whenever i hit the spacebar, it changes to another letter, lets say, B and so on until i reach E. how could i do that?
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 31st Mar 2008 22:05
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Apr 2008 03:20
One approach would be to create an animated sprite and then use the frame command to switch between the images.


[quote]
dbCreateAnimatedSprite
This command will create an animated sprite. The command automatically builds a sequence of animation frames from an image file by cutting up the image into a grid specified by the iAcross and iDown values. The iImage Number will be used to hold the complete image. Use the dbPlaySprite command to see the individual frames of this image.

Syntax
void dbCreateAnimatedSprite ( int iSprite, char* szFilename, int iAcross, int iDown, int iImage )
[quote]


[quote]
dbSpriteFrame
This command will return the frame of the specified sprite. Frames are only returned from animated sprites created with the dbCreateAnimatedSprite command.

Syntax
int dbSpriteFrame ( int iSprite ) [quote]

You need to create an array of images and use this to populate the sprite

If you need additional help please post

Codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem

Login to post a reply

Server time is: 2024-09-29 17:25:35
Your offset time is: 2024-09-29 17:25:35