Mirage Source http://miragesource.net/forums/ |
|
BltItemName http://miragesource.net/forums/viewtopic.php?f=210&t=4447 |
Page 1 of 1 |
Author: | DarkX [ Wed Sep 24, 2008 9:31 pm ] |
Post subject: | BltItemName |
Tested on: MS3.0.3, MS3.0.7, & MSE Build 1 and works Ok I liked the way Diablo 2 did the item system, once it's on the ground it has a name highlighted over it. Well, a Item does not techniquely have a moving postion, so there is no need for the xoffset or yoffset, because the item does not actually move on it's own so here is the code for the bltItemCode In modGameLogic, at the bottom add: Code: Sub BltMapItemName(ByVal Index As Long) Dim TextX As Long Dim TextY As Long With Item(MapItem(Index).Num) 'Draw name TextX = MapItem(Index).x * PIC_X + MapItem(Index).X + CLng(PIC_X / 2) - ((Len(Trim$(.Name)) / 2) * 8) TextY = MapItem(Index).y * PIC_Y + MapItem(Index).Y - CLng(PIC_Y / 2) - 4 DrawText TexthDC, TextX, TextY, Trim$(.Name), vbWhite End With End Sub Then in the same module find this code: Code: ' Lock the backbuffer so we can draw text and names TexthDC = DD_BackBuffer.GetDC For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call BltPlayerName(i, MapXOffset, MapYOffset) End If Next i Beneath it add: Code: 'Draw Item Names For i = LBound(MapItem) To UBound(MapItem) If MapItem(i).Num > 0 Then BltMapItemName i End If Next i and yes this does work without X and Yoffset's as I stated above the items do not move so there not needed unless you write in a seperate moving code for the items but why would you want a item to move? this is straight from my source, it does work, do not change anything. That's all |
Author: | Mattyw [ Wed Sep 24, 2008 9:43 pm ] |
Post subject: | Re: BltItem |
Tested, works on 3.53. =-p |
Author: | GIAKEN [ Wed Sep 24, 2008 9:53 pm ] |
Post subject: | Re: BltItem |
Why use CLng? Instead you should use CByte. |
Author: | DarkX [ Wed Sep 24, 2008 9:57 pm ] |
Post subject: | Re: BltItem |
I just used what I am used to with 3.0.3 and MSEBuild1, feel free to modiy or add the blt on hover thing. |
Author: | Nean [ Wed Sep 24, 2008 10:04 pm ] |
Post subject: | Re: BltItem |
What would be cool, is if when you pushed ALT, the names showed up... ![]() |
Author: | Rezeyu [ Wed Sep 24, 2008 10:05 pm ] |
Post subject: | Re: BltItem |
So add it, it's easy. |
Author: | DarkX [ Wed Sep 24, 2008 10:06 pm ] |
Post subject: | Re: BltItem |
Wouldn't finding a the ke code for it then have a check in the gameloop before the code for blting, have it process it if not then continue without |
Author: | Blodyavenger [ Thu Sep 25, 2008 1:12 pm ] |
Post subject: | Re: BltItemName |
Actualy that additions is realy great. You can add that view in options as well... |
Author: | DarkX [ Thu Sep 25, 2008 8:45 pm ] |
Post subject: | Re: BltItemName |
I am not aroud my visual basic so do not qoute me on this, but it might work( you do have to make them a public const before you can use them Code: 'Draw Item Names if VK_LAlt or VK_RAlt = true then For i = LBound(MapItem) To UBound(MapItem) If MapItem(i).Num > 0 Then BltMapItemName i End If Next i end if Give that a shot, see if it works. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |