| Mirage Source http://web.miragesource.net/forums/ |
|
| Display Sprite on New Char (Different Way) http://web.miragesource.net/forums/viewtopic.php?f=210&t=3389 |
Page 1 of 1 |
| Author: | Stomach Pulser [ Sun Feb 17, 2008 10:52 pm ] |
| Post subject: | Display Sprite on New Char (Different Way) |
Well, I was looking at the tutorial we had here on displaying the sprite on New Character and I came up with a different solution. Here goes. Difficulty: 1 / 5 (Simple) ::Client Side:: Go into your frmNewChar and add a timer, and two picture boxes
The first picture box is your actual display. Size to 32x32 (assuming you have 32x32 sprites). The second picture box should be placed where it won't be seen. Size to 32x32. Auto-size to true. Auto-redraw to true. Add the following code under form_load Code: offscreenpicturebox'snamehere.picture = LoadPicture(App.Path & GFX_PATH & "sprites" & GFX_EXT) Add the following under the timer_tick Code: Call BitBlt(actualdisplaypicturebox'snamehere.hDC, 0, 0, 32, 32, offscreenpicturebox'snamehere, DIR_DOWN * PIC_X, cmbClass.ListIndex * PIC_Y, SRCCOPY) That is all. Now, when you change the cmbClass to something else, it will blt that sprite. Replace names with what you named your stuff. [NOTE]this only works if you have your classes where class 0 is sprite 0, class 1 is sprite 1, etc. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|