Mirage Source http://www.miragesource.net/forums/ |
|
Blitting Stuff... http://www.miragesource.net/forums/viewtopic.php?f=143&t=5792 |
Page 1 of 1 |
Author: | Nean [ Mon Jun 15, 2009 7:24 pm ] |
Post subject: | Blitting Stuff... |
Okay so I'm working on a way old source, dicking around. I made a /rest feature, where when you're resting you regen twice as much MP and HP, however you cannot move whatsoever or attack or cast spells, and you take twice the damage when you're resting. However now I need to get it to where an icon is drawn over the players character when they're resting. I have this in the gameloop Code: If IsPlaying(I) Then If GetPlayerMap(I) = GetPlayerMap(MyIndex) Then If Player(I).IsResting = True Then BltRestIcon I End If End If End If Now I just need to know what to put in Code: Sub BltRestIcon() End Sub I've looked at the other drawing and whatnot, but it seemed to different to really help me out. |
Author: | GIAKEN [ Mon Jun 15, 2009 7:34 pm ] |
Post subject: | Re: Blitting Stuff... |
Easy stuff, yo. Code: Private Sub BltRestIcon(ByVal Index As Long) Dim rec As DXVBLib.RECT With rec .Top = 0 .Bottom = 32 .Left = 0 .Right = 32 End With Call DD_BltFast(GetPlayerX(Index) * 32, (GetPlayerY(Index) * 32) - 32, DDS_RestIcon, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End Sub Then call this somewhere: Code: Call InitDDSurf("resticon", DDS_RestIcon) And make sure you have a resticon.bmp. The rec defines the size of the image...for example the rec I have set up does a 32x32 selection from the resticon.bmp at 0,0 (very top left). |
Author: | Egon [ Mon Jun 15, 2009 7:35 pm ] |
Post subject: | Re: Blitting Stuff... |
Can't you just rip the emotion bubble code and change it around so they don't disappear? That's how I'd do it anyway. |
Author: | GIAKEN [ Mon Jun 15, 2009 7:39 pm ] |
Post subject: | Re: Blitting Stuff... |
There isn't emoticon code in MS4. |
Author: | Nean [ Mon Jun 15, 2009 8:12 pm ] |
Post subject: | Re: Blitting Stuff... |
I was using an Old ED source though. However you both helped me immensely, thanks. Both examples helped me get it. |
Author: | GIAKEN [ Mon Jun 15, 2009 8:14 pm ] |
Post subject: | Re: Blitting Stuff... |
OH YEAH I forgot it's for HO which is old ED...alright my bad |
Author: | Nean [ Mon Jun 15, 2009 8:20 pm ] |
Post subject: | Re: Blitting Stuff... |
Here's what I have: Code: Private Sub BltRestIcon(ByVal Index As Long) Dim rec As DXVBLib.RECT Dim X2 As Long Dim Y2 As Long X2 = NewX + sx + 0 If GetPlayerGuild(Index) <> vbNullString Then Y2 = NewY + sx - 42 Else Y2 = NewY + sx - 30 End If With rec .Top = 0 .Bottom = 32 .Left = 0 .Right = 32 End With Call DD_BackBuffer.BltFast(X2, Y2, DD_RestIcon, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End Sub Does this look good? Seems to display right for me, but will it display right for everyone? |
Author: | GIAKEN [ Mon Jun 15, 2009 9:58 pm ] |
Post subject: | Re: Blitting Stuff... |
Need to use GetPlayerX and Y in there...look at other code like spells or something. |
Author: | Nean [ Tue Jun 16, 2009 3:41 am ] |
Post subject: | Re: Blitting Stuff... |
Yeah, I got it fixed. <3 you guys. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |