Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Grid in Map


Alerd
 Share

Recommended Posts

Welcome to today's tutorial will show you how to make a grid on the map

First go to client > frmEditor_Map and Create Checkbox (chkGrid) double-click and type```

ShowGrid = chkGrid.Value

```

Next

Go to the ModGlobals and we add

```

Public ShowGrid As Byte

```

Next

Search```

Public Sub BltDirection(ByVal X As Long, ByVal Y As Long)

```

We add the

```

If Options.Debug = 1 Then On Error GoTo errorhandler

```

this

```

' render grid

rec.top = 24

rec.Left = 0

rec.Right = rec.Left + 32

rec.Bottom = rec.top + 32

Call Engine_BltFast(ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), DDS_Direction, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

```

Next go to modDirectDraw7

add this

```

Public Sub BltGrid(ByVal X As Long, ByVal Y As Long)

Dim rec As DxVBLib.RECT

' render grid

rec.top = 24

rec.Left = 0

rec.Right = rec.Left + 32

rec.Bottom = rec.top + 32

Call Engine_BltFast(ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), DDS_Direction, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

End Sub

```

In modDirectDraw7 search

```

' blit out a square at mouse cursor

If InMapEditor Then

If frmEditor_Map.optBlock.Value = True Then

For X = TileView.Left To TileView.Right

For Y = TileView.top To TileView.Bottom

If IsValidMapPoint(X, Y) Then

Call BltDirection(X, Y)

End If

Next

Next

End If

Call BltTileOutline

End If

```

add the

```

If ShowGrid Then

For X = TileView.Left To TileView.Right

For Y = TileView.top To TileView.Bottom

If IsValidMapPoint(X, Y) Then

Call BltGrid(X, Y)

End If

Next

Next

End If

```

Srry for my bad English
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...