Standelf Moderador
Cantidad de envíos : 11 Fecha de inscripción : 05/10/2008 Edad : 31 Localización : En este momento en tu mente
| Tema: [Aporte] Sistema de MiniMapa Dom Oct 05, 2008 5:10 am | |
| Bueno les dejo otro sistema de minimapa ScreenShoot:1 - Buscamos: - Código:
-
Sub CargarAnimsExtra() y Agregamos abajo: - Código:
-
Dim DDm As DDSURFACEDESC2 DDm.lHeight = 101 DDm.lWidth = 101 DDm.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY DDm.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH Set SupMiniMap = DirectDraw.CreateSurface(DDm) Set SupBMiniMap = DirectDraw.CreateSurface(DDm) 2 - En el Modulo declaraciones agregamos: - Código:
-
Public SupBMiniMap As DirectDrawSurface7 Public SupMiniMap As DirectDrawSurface7 3 - Presten Atencion:En 11.5 Al final del Modulo general Agregan - Código:
-
Public Sub DibujarMiniMapa(ByRef Pic As PictureBox) Dim DR As RECT DR.Left = 0 DR.Top = 0 DR.Bottom = 100 DR.Right = 100 SupMiniMap.BltFast 1, 1, SupBMiniMap, DR, DDBLTFAST_WAIT DR.Left = UserPos.X - 4 DR.Top = UserPos.Y - 4 DR.Bottom = UserPos.Y - 2 DR.Right = UserPos.X - 2 SupMiniMap.BltColorFill DR, &HFFFF00 DR.Left = 0 DR.Top = 0 DR.Bottom = 100 DR.Right = 100 SupMiniMap.BltToDC Pic.Hdc, DR, DR End Sub Public Sub GenerarMiniMapa() Dim X As Integer Dim Y As Integer Dim i As Integer Dim DR As RECT Dim SR As RECT Dim aux As Integer SR.Left = 0 SR.Top = 0 SR.Bottom = 100 SR.Right = 100 'SupBMiniMap.BltColorFill SR, vbBlack For X = MinYBorder To MaxXBorder For Y = MinYBorder To MaxYBorder If MapData(X, Y).Graphic(1).GrhIndex > 0 Then With MapData(X, Y).Graphic(1) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.Surface(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If If MapData(X, Y).Graphic(2).GrhIndex > 0 Then With MapData(X, Y).Graphic(2) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.Surface(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If If MapData(X, Y).Graphic(3).GrhIndex > 0 Then With MapData(X, Y).Graphic(3) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.Surface(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If Next Next End Sub En 11.2 Al final del Modulo General agregan: - Código:
-
Public Sub DibujarMiniMapa(ByRef Pic As PictureBox) Dim DR As RECT DR.Left = 0 DR.Top = 0 DR.Bottom = 100 DR.Right = 100 SupMiniMap.BltFast 1, 1, SupBMiniMap, DR, DDBLTFAST_WAIT DR.Left = UserPos.X - 4 DR.Top = UserPos.Y - 4 DR.Bottom = UserPos.Y - 2 DR.Right = UserPos.X - 2 SupMiniMap.BltColorFill DR, vbWhite
DR.Left = 0 DR.Top = 0 DR.Bottom = 100 DR.Right = 100 SupMiniMap.BltToDC Pic.Hdc, DR, DR End Sub Public Sub GenerarMiniMapa() Dim X As Integer Dim Y As Integer Dim i As Integer Dim DR As RECT Dim SR As RECT Dim aux As Integer SR.Left = 0 SR.Top = 0 SR.Bottom = 100 SR.Right = 100 'SupBMiniMap.BltColorFill SR, vbBlack For X = MinYBorder To MaxXBorder For Y = MinYBorder To MaxYBorder If MapData(X, Y).Graphic(1).GrhIndex > 0 Then With MapData(X, Y).Graphic(1) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.GetBMP(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If If MapData(X, Y).Graphic(2).GrhIndex > 0 Then With MapData(X, Y).Graphic(2) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.GetBMP(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If If MapData(X, Y).Graphic(3).GrhIndex > 0 Then With MapData(X, Y).Graphic(3) i = GrhData(.GrhIndex).Frames(1) End With SR.Left = GrhData(i).sX SR.Top = GrhData(i).sY SR.Right = GrhData(i).sX + GrhData(i).pixelWidth SR.Bottom = GrhData(i).sY + GrhData(i).pixelHeight DR.Left = X - 5 DR.Top = Y - 5 DR.Bottom = Y - 3 DR.Right = X - 3 SupBMiniMap.Blt DR, SurfaceDB.GetBMP(GrhData(i).FileNum), SR, DDBLT_DONOTWAIT End If Next Next End Sub 4 - Buscamos: - Código:
-
Case "LOGGED" Y agregamos abajo: - Código:
-
Call DibujarMiniMapa(frmMain.Minimap) 5 - Presten Atencion:En 11.5 Buscamos: - Código:
-
Sub SwitchMap(ByVal Map As Integer) En 11.2 Buscamos: - Código:
-
Sub SwitchMap(ByVal Map As Integer) En 9.9 Buscamos: - Código:
-
Sub SwitchMap(Map As Integer) y antes del End Sub agregamos: - Código:
-
Call GenerarMiniMapa 6 - En el frmMain creamos un nuevo PictureBox con estas propiedades: - Citación :
Name = Minimap AutoRedraw = True Height = 100 ScaleMode = 3 - Pixel Width = 100
Listo Ahi tenemos el Minimapa Nuevo. Bonus: Si queremos Ubicar el Minimapa Sobre el Screen Sin que Titile: por esto) 1 - En el frmmain cambiamos la propiedad: - Código:
-
ClipControls =True 2 - Buscamos en el sub ShowNextFrame: - Código:
-
Call DrawBackBufferSurface y Abajo ponemos: - Código:
-
frmMain.Minimap.Refresh y Listo, Nos quedaria asi masomenos: - Spoiler:
Listo ^^ Para este no tienen que usar colorfinder ni nada, Con poner el codigo anda ^^ Aclaración: No lo hice yo, lo encontre en mi pc, lo unico que hice fue hacerlo andar xD, y adaptarlo a 9.9 y 11.2 Espero que les sirva
Testeado y Funcional 9.9, 11.2 y 11.5 | |
|
darkk knight Administrador
Cantidad de envíos : 52 Fecha de inscripción : 04/10/2008
| Tema: Re: [Aporte] Sistema de MiniMapa Sáb Oct 18, 2008 7:44 pm | |
| STANDELF TE ANDO BUSCANDO PLIS
BUEN APORTE^^ | |
|
XBOX Administrador
Cantidad de envíos : 71 Fecha de inscripción : 03/10/2008 Edad : 35 Localización : ...:::XBOX:::...
| Tema: Re: [Aporte] Sistema de MiniMapa Sáb Oct 18, 2008 7:46 pm | |
| | |
|
francoo27 Moderador
Cantidad de envíos : 55 Fecha de inscripción : 11/10/2008 Localización : NOSE ESTOY PERDIDOO
| Tema: Re: [Aporte] Sistema de MiniMapa Sáb Oct 18, 2008 8:03 pm | |
| | |
|
Contenido patrocinado
| Tema: Re: [Aporte] Sistema de MiniMapa | |
| |
|