Originally Posted by
Keebellah
I think you should just add 8 separate images and select the one you want
Hi Keebellah,
The problem is, I was just giving 8 as an example. Most spritesheets will have probably at least 100 sprites on them. It's not really feasible to crop them all to perfect alignment, this also increases the file size exponentially, going from 1 image, to hundreds.
That being said. I was able to solve this problem over breakfast;
Frames!
I can place the full sized image control inside a frame that is sized to the sprite, then using the .Top and .Left functions on the image control to position it inside the frame.
If anyone wants to give this a try, I will provide a sample 4 x 4 sprite sheet;
sprites.gif
- Save above picture as "sprites.gif"
- Create a UserForm.
- Place a Frame control on the UserForm (No Caption, Disable Borders, Set TabStop to False) measuring 48pts by 48pts (48pts = 64px).
- Place an Image control INSIDE the Frame (Disable Borders, Set AutoSize to True)
In the UserForm1 code, paste the following;
You can control the characters movement using the Arrow keys.
Bookmarks