Alerd Posted March 21, 2013 Author Share Posted March 21, 2013 Welcome to today's tutorial will show you how to make a grid on the mapFirst go to client > frmEditor_Map and Create Checkbox (chkGrid) double-click and type```ShowGrid = chkGrid.Value```NextGo to the ModGlobals and we add```Public ShowGrid As Byte```NextSearch```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 gridrec.top = 24rec.Left = 0rec.Right = rec.Left + 32rec.Bottom = rec.top + 32Call Engine_BltFast(ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), DDS_Direction, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)```Next go to modDirectDraw7add this```Public Sub BltGrid(ByVal X As Long, ByVal Y As Long)Dim rec As DxVBLib.RECT' render gridrec.top = 24rec.Left = 0rec.Right = rec.Left + 32rec.Bottom = rec.top + 32Call 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 cursorIf 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 BltTileOutlineEnd 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 NextEnd If```Srry for my bad English Link to comment Share on other sites More sharing options...
barreytor Posted March 21, 2013 Share Posted March 21, 2013 You probably should point out that it's for EO 2 and other DX7 engines, but nice tutorial, simple and to the point. Link to comment Share on other sites More sharing options...
Alerd Posted March 21, 2013 Author Share Posted March 21, 2013 Thanx ;] Link to comment Share on other sites More sharing options...
abhi2011 Posted March 21, 2013 Share Posted March 21, 2013 Nice. It would be good if you get someone to fix your english. And also why use a byte? Use a boolean. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now