![]() |
|
Display Sprite on New Char (Different Way) - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Display Sprite on New Char (Different Way) (/showthread.php?tid=1567) |
Display Sprite on New Char (Different Way) - Stomach Pulser - 17-02-2008 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
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. |