Mirage Source http://web.miragesource.net/forums/ |
|
[MS4How would i be able to change the sprite format to this? http://web.miragesource.net/forums/viewtopic.php?f=184&t=6205 |
Page 1 of 47 |
Author: | Robin [ Sun Sep 06, 2009 1:28 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Code: Public Sub DrawSprite(ByVal X As Long, ByVal Y As Long, ByVal Dir As Byte)
Dim srcRECT As DxVBLibA.RECT With CDX8 .SetTexture TextureID.sprite1 Select Case Dir Case 1 'Up srcRECT.Top = 96 '0 Case 2 'Down srcRECT.Top = 0 '96 Case 3 'Left srcRECT.Top = 32 Case 4 'Right srcRECT.Top = 64 End Select srcRECT.Left = 33 srcRECT.Right = srcRECT.Left + 32 srcRECT.bottom = srcRECT.Top + 32 .TextureControl X * 4, Y * 4, srcRECT.Right - srcRECT.Left, srcRECT.bottom - srcRECT.Top, srcRECT.Left, srcRECT.Top, , False .Draw End With End Sub |
Author: | bluedude13 [ Sun Sep 06, 2009 1:39 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Where would i put this i tried to find it but there is none... |
Author: | Robin [ Sun Sep 06, 2009 1:56 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
bluedude13 wrote: Where would i put this i tried to find it but there is none... It's just an example, you'll need to edit BltPlayer to do it yourself. |
Author: | GIAKEN [ Sun Sep 06, 2009 2:12 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Yeah it's really simple. |
Author: | bluedude13 [ Sun Sep 06, 2009 2:27 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Ahh man i tried but i get lots of errors can some one help? Code: Public Sub BltPlayer(ByVal Index As Long)
Dim Anim As Long Dim I As Long Dim SpellNum As Long Dim X As Long Dim Y As Long Dim Sprite As Long Dim rec As DXVBLib.RECT Sprite = GetPlayerSprite(Index) ' Check for animation Anim = 0 If Player(Index).Attacking = 0 Then Select Case GetPlayerDir(Index) Case DIR_UP If (Player(Index).YOffset < SIZE_Y / 96) Then Anim = 1 Case DIR_DOWN If (Player(Index).YOffset < SIZE_Y / 0 * -1) Then Anim = 1 Case DIR_LEFT If (Player(Index).XOffset < SIZE_Y / 32) Then Anim = 1 Case DIR_RIGHT If (Player(Index).XOffset < SIZE_Y / 64 * -1) Then Anim = 1 End Select Else If Player(Index).AttackTimer + 500 > GetTickCount Then Anim = 2 End If End If ' Check to see if we want to stop making him attack With Player(Index) If .AttackTimer + 1000 < GetTickCount Then .Attacking = 0 .AttackTimer = 0 End If End With With rec .Top = 0 .Bottom = SIZE_Y .Left = (GetPlayerDir(Index) * 3 + Anim) * SIZE_X .Right = .Left + SIZE_X End With X = GetPlayerX(Index) * SIZE_X + Player(Index).XOffset Y = GetPlayerY(Index) * SIZE_Y + Player(Index).YOffset - 4 ' to raise the sprite by 4 pixels ' Check if its out of bounds because of the offset If Y < 0 Then Y = 0 With rec .Top = .Top + (Y * -1) End With End If |
Author: | GIAKEN [ Sun Sep 06, 2009 2:40 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Code: With rec .Top = GetPlayerDir(Index) * SIZE_Y .Bottom = .Top + SIZE_Y .Left = Anim * SIZE_X .Right = .Left + SIZE_X End With That should be it. |
Author: | bluedude13 [ Sun Sep 06, 2009 2:55 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
But now it says ERROR Missing file |
Author: | GIAKEN [ Sun Sep 06, 2009 2:56 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Umm ok that has nothing to do with BltPlayer. How are you loading your sprites? |
Author: | bluedude13 [ Sun Sep 06, 2009 2:59 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Well i just changed my sprite to Sprite 16 ( the rpg maker sprite format) and then i changed it to 2.bmp or 17.bmp and everytime it says its missing... |
Author: | Robin [ Sun Sep 06, 2009 3:00 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Did you actually place .BMP files in there, or did you put .PNG files in there? |
Author: | bluedude13 [ Sun Sep 06, 2009 3:02 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
it was a Bmp why should it be png? |
Author: | GIAKEN [ Sun Sep 06, 2009 3:06 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
The sprites you showed us are PNGs. |
Author: | bluedude13 [ Sun Sep 06, 2009 3:25 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Hmm wait.. |
Author: | GIAKEN [ Sun Sep 06, 2009 3:28 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Open them in paint and save as 24-bit BMPs. And make sure the first sprite file is sprite0 or sprite1 I forgot what it starts at. |
Author: | bluedude13 [ Sun Sep 06, 2009 3:59 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
It works now but everything back wards like i tried switching the code around but it didn't work THis is how its like |How its supposed to be| |How it is now | left------------------------------------>Right right---------------------------------->Up up------------------------------------->Down Down---------------------------------->Left |
Author: | GIAKEN [ Sun Sep 06, 2009 5:11 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Code: Select Case GetPlayerDir(MyIndex)
Case DIR_DOWN .Top = DIR_LEFT * SIZE_Y Case DIR_LEFT .Top = DIR_DOWN * SIZE_Y Case DIR_RIGHT .Top = DIR_UP * SIZE_Y Case Dir_UP .Top = DIR_RIGHT * SIZE_Y End Select With rec .Bottom = .Top + SIZE_Y .Left = Anim * SIZE_X .Right = .Left + SIZE_X End With |
Author: | bluedude13 [ Sun Sep 06, 2009 1:08 pm ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Aww i cant do it i keep getting so many errors and i cannot find the GetplayerDir your talking about all you do is paste the code! Sorry. |
Author: | GIAKEN [ Sun Sep 06, 2009 4:31 pm ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to this? |
Oops just change MyIndex to Index there... |
Author: | wanai [ Wed Jan 19, 2022 11:54 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to t |
Este |
Author: | wanai [ Wed Jan 19, 2022 11:55 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to t |
153.3 |
Author: | wanai [ Wed Jan 19, 2022 11:56 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to t |
Bett |
Author: | wanai [ Wed Jan 19, 2022 11:57 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to t |
Bett |
Author: | wanai [ Wed Jan 19, 2022 11:58 am ] |
Post subject: | Re: [MS4How would i be able to change the sprite format to t |
Fion |
Page 1 of 47 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |