Jump to content

Recoil

Contributors
  • Posts

    184
  • Joined

  • Last visited

Everything posted by Recoil

  1. Try either ShareTechMono-Regular or Lucida Console (lucon). One of those did it for me I believe.
  2. The [] is only because of the font you are using. I had to switch fonts with Revamped because of this same issue. You will have to either change the font or make a new line with the remaining text.
  3. You know the old saying, If they have big hands, and they have big feet,...
  4. I like it, and it looks pretty good IMO. The shadows give it more depth, don't remove them.
  5. I'm checking things out and trying to get a feel for setting this up. My knowledge of databases is a bit rusty, and my experience was limited to working with Access DB files in Visual Studio...like 8-9 years ago. My biggest concern is the foreign key fields. Currently when I launch OTT I add/launch a campaign. Adding creates a new folder in the application directory, with an options file specific to that campaign, along with a folder that houses the map files. Maps are specific to a campaign. When the campaign is launched and on a map, I can add unique tokens to that map. So, tokens created on Map1 are not accessible on Map2 and must be recreated. They are unique to each map, and are not like separate NPC's. Campaign Table: CREATE TABLE `CAMPAIGNS` ( `CAMPAIGN_ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `CAMPAIGN_NAME` TEXT NOT NULL DEFAULT 'New Campaign', `SETTINGS_LAST_MAP` INTEGER NOT NULL DEFAULT 1, `SETTINGS_AUTO_UPDATE_PLAYERS` INTEGER NOT NULL DEFAULT 0, `SETTINGS_MAX_MAP_X` INTEGER NOT NULL DEFAULT 27, `SETTINGS_MAX_MAP_Y` INTEGER NOT NULL DEFAULT 15, `SETTINGS_RESOLUTION` INTEGER NOT NULL DEFAULT 0, `TIME_LAST_HOUR` INTEGER NOT NULL DEFAULT 9, `TIME_LAST_MINUTE` INTEGER NOT NULL DEFAULT 0, `LEVELS_DAWN` INTEGER NOT NULL DEFAULT 180, `LEVELS_MIDDAY` INTEGER NOT NULL DEFAULT 0, `LEVELS_DUSK` INTEGER NOT NULL DEFAULT 180, `LEVELS_NIGHT` INTEGER NOT NULL DEFAULT 200, `LEVELS_CAVE` INTEGER NOT NULL DEFAULT 220, `GRID_SHOW_GRID_LINES` INTEGER NOT NULL DEFAULT 1, `GRID_RED_VALUE` INTEGER NOT NULL DEFAULT 255, `GRID_GREEN_VALUE` INTEGER NOT NULL DEFAULT 255, `GRID_BLUE_VALUE` INTEGER NOT NULL DEFAULT 255, `GRID_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_TILES_AUTO_SHADOW` INTEGER NOT NULL DEFAULT 1, `LAYERS_GROUND_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_CLUTTER_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_WALLS_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_SHADOWS_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_OVERHEAD_OPACITY` INTEGER NOT NULL DEFAULT 255, `LAYERS_FOW_OPACITY` INTEGER NOT NULL DEFAULT 255, `TOKENS_SHOW_TOKENS` INTEGER NOT NULL DEFAULT 1, `TOKENS_TOKEN_OPACITY` INTEGER NOT NULL DEFAULT 255 ) In my Maps Table, I have an extra field for the Campaign_ID that a map is tied to [ ForeignKey: `CAMPAIGNS`(`CAMPAIGN_ID`) ]. My understanding is that when launched into the campaign it will only be able to display maps specific to that campaign: Maps Table: CREATE TABLE "MAPS" ( `MAP_ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `MAP_CAMPAIGN_ID` INTEGER NOT NULL, `MAP_NAME` TEXT NOT NULL DEFAULT 'Empty', `MAP_REVISION` INTEGER NOT NULL DEFAULT 0, `MAP_TILESET` INTEGER NOT NULL DEFAULT 0, `MAP_TYPE` INTEGER NOT NULL DEFAULT 0, `MAP_NORTH` INTEGER NOT NULL DEFAULT 0, `MAP_SOUTH` INTEGER NOT NULL DEFAULT 0, `MAP_WEST` INTEGER NOT NULL DEFAULT 0, `MAP_EAST` INTEGER NOT NULL DEFAULT 0, `MAP_MAX_X` INTEGER NOT NULL DEFAULT 27, `MAP_MAX_Y` INTEGER NOT NULL DEFAULT 15, `MAP_TILES` BLOB, FOREIGN KEY(`MAP_CAMPAIGN_ID`) REFERENCES CAMPAIGNS(CAMPAIGN_ID) ) Likewise, in my Tokens Table, there is an extra field for the MAP_ID that this token is tied to [ ForeignKey: `MAPS`(`MAP_ID`) ]. When on the map it will only select the Tokens specific to that map: Tokens Table CREATE TABLE "TOKENS" ( `TOKEN_ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `TOKEN_MAP_ID` INTEGER NOT NULL, `TOKEN_NAME` TEXT NOT NULL DEFAULT 'Token', `TOKEN_SPRITE` INTEGER NOT NULL DEFAULT 0, `TOKEN_X` INTEGER NOT NULL DEFAULT 0, `TOKEN_Y` INTEGER NOT NULL DEFAULT 0, `TOKEN_DIR` INTEGER NOT NULL DEFAULT 0, `TOKEN_SCALE` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`TOKEN_MAP_ID`) REFERENCES MAPS(MAP_ID) ) In my experience, databases is not something you can really "wing-it" on, and work so much better when they are mapped out properly ahead of time. So...I would like some advice on what I currently have setup. Also, I am still unsure how I am going to go about the layers and tiles when saving and loading the maps. I have that set to a BLOB data field [ `MAP_TILES` BLOB, ], but how am I supposed to compile the list of stuff that will go in there to save it, as well as read it back out when I am loading the map?
  6. Recoil

    List(of T)

    On initial startup, I am doing this now, which is cleaner, but still does the same thing as I was doing before: Friend Sub CheckMaps() ' Create the initial list of map names for cboMapWarp. MapNameList = New List(Of String)() MapNameList.Clear() MapNameList.Add("None") ' Create new initial list of maps. Map = New List(Of Maps) ' Check each file in the directory. For Each MapFile In Directory.GetFiles(Application.StartupPath & "\Data Files\Campaigns\" & CampaignName & "\Maps\") 'Map" & i & MapExt) ' If it has the MapExt then add it to our count. If MapFile.EndsWith(MapExt) Then MapCount += 1 ' Open up a space in our list. Map.Add(New Maps) ' - By itself causes out of range exception: CheckMap -> FileGetObject(f, Map(mapNum).Name) End If Next ' Check if we are first starting a new campaign and there are no maps. If MapCount = 0 Then MakeNewMap(1) End If End Sub On a new campaign, there are no maps in the directory, so I have to make one: Private Sub MakeNewMap(ByVal mapNum As Long) ' If not let's create the next map in our index. MapCount += 1 ' Open up a space in our list. Map.Add(New Maps) ' Save the newly create map. SaveMap(mapNum) End Sub I am getting my error on the bottom of this: Private Sub SaveMap(ByVal mapNum As Long) ' Note: Do not use this method outside of this module...use SetSaveMap instead. Dim fileName As String = Application.StartupPath & "\Data Files\Campaigns\" & CampaignName & "\Maps\" & "Map" & mapNum & MapExt Dim f As Long Dim x As Long Dim y As Long f = FreeFile() FileOpen(f, fileName, OpenMode.Binary, OpenAccess.Write, OpenShare.Default) FilePutObject(f, Map(mapNum).Name) Auto Locals: Map : Count=1 f : 1 mapnum : 1 The filename is correct, it creates Map1.map in the directory when it has this error...so I restart, and on loading Map1.map, it errors on load, on the same Map(mapNum).Name when it is getting it.
  7. Recoil

    List(of T)

    Alright, this is what is going on now: That happens at...: FilePutObject(f, Map(mapNum).Name) ...when I am creating a new map, and saving it...that is without all the inserts, and also without checking the names of the maps to add to a list. This is telling me that there is no enough space in the list indices to save a blank map. Now if there is already premade maps in the directory, it will go through...but will not create any new maps, unless I add, then insert a new map, otherwise it is goin to keep throwing out of range exceptions, when there is no range to except on. Just reaching out here if anyone has any ideas that are different than what I have already figured out. This isn't really the easiest thing to work out.
  8. Recoil

    List(of T)

    I actually have to put in insert just to make it work for some reason, and I know that is why my count is double. It is the weirdest issue I have ever had working with a list. But I am also converting things on top of an already built engine that was designed to run differently than what I am trying to make it do. I have made some slight changes. I am going to try and get rid of all the inserts and work my way up from there.
  9. Recoil

    List(of T)

    I am running into an issue adding my maps to a List(of Maps). I have bypassed the MaxMaps requirement, so this wil create maps as they are needed, and not limit the program to a set number. If I can figure this issue out, it may help figure out why I ahve to have a set limit, and add/insert for my MapTokens. First my map class: Global declaration: Public Map As List(Of Maps) When the app is running, I have a button to add a new map to the directory: Private Sub btnAddNewMap_Click(sender As Object, e As EventArgs) Handles btnAddNewMap.Click If MsgBox("Create a new map?", vbYesNo, GameName) = vbYes Then Dim i As Integer = cboMapWarp.Items.Count CreatingNewMap = True CheckMap(i) End If End Sub That goes through to: Public Sub CheckMap(ByVal mapNum As Long) ' Loads an empty map in memory so there is no null error. ClearMap(mapNum) ' Check if the map exists. If Not FileExist(Application.StartupPath & "\Data Files\Campaigns\" & CampaignName & "\Maps\" & "Map" & mapNum & MapExt) Then MakeNewMap(mapNum) End If ' Set our control max values. DmScreen.scrlMapWarpMap.Maximum = MapCount DmScreen.nudNorth.Maximum = MapCount DmScreen.nudEast.Maximum = MapCount DmScreen.nudSouth.Maximum = MapCount DmScreen.nudWest.Maximum = MapCount End Sub Here is how I HAVE to make a new map with both Add & Insert, otherwise I get out of range exceptions: Private Sub MakeNewMap(ByVal mapNum As Long) ' If not let's create the next map in our index. MapCount += 1 ' Open up a space in our list. Map.Add(New Maps) ' Insert a blank map in that space. Map.Insert(mapNum, New Maps) ' Save the newly create map. SaveMap(mapNum) End Sub That works for making a new map, but my Map.Count is always twice the number of maps I have. And here on initial load I am checking the maps: Friend Sub CheckMaps() ' Check each file in the directory. For Each MapFile In Directory.GetFiles(Application.StartupPath & "\Data Files\Campaigns\" & CampaignName & "\Maps\") 'Map" & i & MapExt) ' If it has the MapExt then add it to our count. If MapFile.EndsWith(MapExt) Then MapCount += 1 End If Next ' Create new initial list of maps. Map = New List(Of Maps) ' Check if we are first starting a new campaign and there are no maps. If MapCount = 0 Then MakeNewMap(1) ' We are going to count again below for ALL the maps. Map.Clear() End If ' Create the initial list of map names for cboMapWarp. MapNameList = New List(Of String)() MapNameList.Clear() MapNameList.Add("None") For x = 1 To MapCount ' Open up a space in our list. Map.Add(New Maps) ' Insert a blank map in that space. Map.Insert(x, New Maps) ' Open each map file, check the name, add it to our list of map names. CheckMapName(x) Next ' TODO: By the time I get here Map.Count is twice the number of maps I have...? MessageBox.Show(Map.Count) End Sub At the bottom of that I have to Add & Insert a map index into the list. And even starting out my Map.Count is always twice the number of maps I actually have in the folder. Inserting alone cases out of range exceptions. However, when I simply Add I get an out of range exception when I am checking the map name to put in a list that populates a combobox: Private Sub CheckMapName(ByVal mapNum As Long) Dim fileName As String = Application.StartupPath & "\Data Files\Campaigns\" & CampaignName & "\Maps\" & "Map" & mapNum & MapExt Dim f As Long = FreeFile() FileOpen(f, fileName, OpenMode.Binary, OpenAccess.Read, OpenShare.Default) FileGetObject(f, Map(mapNum).Name) ' ERRORS HERE... ' Add the name in our list of map names. MapNameList.Add(mapNum & ": " & Map(mapNum).Name) FileClose(f) End Sub While everything here works, my Map.Count is always double. Likewise, even though I have a max on the map tokens, the actual count of the List(of MapTokens) is always twice as much as the number of tokens I have. I am unable to get anything to work without both Adding/Inserting.
  10. Recoil

    Map zoom

    Okay, so the solution is stupid...posting this here just in case anyone runs into it...but doubtful. This key bit of code adjust the size of my map window depending on how large the map width and height are. This is because my app supports various resolutions: DmScreen.picDmScreen.Size = New Size(((Map(CurrentMap).MaxX) * PicX), ((Map(CurrentMap).MaxY) * PicY)) This is what I have been trying because I need to window size to scale, so the scrollbars work properly. It needs to scale by the double value of the nudZoomFactor: DmScreen.picDmScreen.Size = New Size(((Map(CurrentMap).MaxX) * PicX) * ZoomFactor, ((Map(CurrentMap).MaxY) * PicY) * ZoomFactor) I have also been dividing by the ZoomFactor variable. I pulled this bit of insight from the SFML tutorials, thinking this would work...it DID appear to work at first: DmWindow.SetView(New View(New FloatRect(0, 0, (MaxMapX * PicX) / ZoomFactor, (MaxMapY * PicY) / ZoomFactor))) But the reason I kept running into my issue with the black bars WAS because of that last nugget of wisdom. Since I am already scaling the width and height of the map window by the ZoomFactor, that is all it took and I did not have to include this...which would have saved me several hours. In the examples for SFML the were not changing the size of the window...they were scaling IN on the window they had already. In short, if you are changing the size of the map window, you do not need to scale the SetView of the TextureWindow.
  11. Recoil

    Map zoom

    I have a NumericUpDown control (nudZoomFactor). It is set at 1.0. Minimum is 0.5. Maximum is 2.0 In it's value changed event, it sets a double variable (ZoomFactor) to its value, then calls to adjust the scroll bars on bottom and right side of the panel that holds the picturebox for the map: Private Sub nudZoomFactor_ValueChanged(sender As Object, e As EventArgs) Handles nudZoomFactor.ValueChanged If InGame = False Then Exit Sub ZoomFactor = nudZoomFactor.Value AdjustMapScrollbars() End Sub This same sub is called when the form maximizes, to either show or hide the scrollbars depending on the maps picturebox size in relation to the parent panel's size. If they are to show, it will set the max value of the scrollbar, because of the various resolutions this app will go up to: Public Sub AdjustMapScrollbars() DmScreen.picDmScreen.Location = New Point(0, 0) DmScreen.picDmScreen.Size = New Size(((Map(CurrentMap).MaxX) * PicX), ((Map(CurrentMap).MaxY) * PicY)) If DmScreen.picDmScreen.Width > DmScreen.panDmScreenBack.Width Then DmScreen.scrlBottomScreen.Visible = True DmScreen.scrlBottomScreen.Maximum = (DmScreen.picDmScreen.Width / PicX - (DmScreen.panDmScreenBack.Width / PicX)) Else DmScreen.scrlBottomScreen.Visible = False DmScreen.scrlBottomScreen.Maximum = (DmScreen.picDmScreen.Width / PicX) End If If DmScreen.picDmScreen.Height > DmScreen.panDmScreenBack.Height Then DmScreen.scrlRightScreen.Visible = True DmScreen.scrlRightScreen.Maximum = (DmScreen.picDmScreen.Height / PicY - (DmScreen.panDmScreenBack.Height / PicY)) Else DmScreen.scrlRightScreen.Visible = False DmScreen.scrlRightScreen.Maximum = (DmScreen.picDmScreen.Height / PicY) End If End Sub In Render_Graphics() I am setting the amount to zoom in: DmWindow.SetView(New View(New FloatRect(0, 0, (MaxMapX * PicX) / ZoomFactor, (MaxMapY * PicY) / ZoomFactor))) Now, when I change the value of nudZoomFactor, it resets the view back to 0,0 from the SetView, until I move a scroll bar. Now, when I scroll all the way to the right, or all the way to the bottom it will show a big black area over the right and bottom of the map. The more I zoom in, the wider the black areas are. The goal here is when I zoom in, still be able to scroll the full width and height of the map without the black bars. I have tried adjusting the settings in the UpdateCamera sub, but changing those values to either multiply or divide by the ZoomFactor, they do nothing to the viewable ares of the window.
  12. Crappy job wants all my ideas.... Highlighted important points here... A: Don't write software at work, or on their equipment, even if you are at home. Don't look up stuff for your personal software, on their equipment. B: Don't write software that uses logic you have pulled from a program you are working on for them. C: They have to show that AHEAD of time, they had potential research "anticipated" or invested in something you are doing. You cannot begin writing software, and suddenly they decide to research it, or write software that would put you in violation after the fact. You can fight stuff like this, but sadly it is the one with the most money who will win a suit like this. Just flat out refuse to sign it, and explain that you write personal software for yourself, and anything you do on your personal time, at any time, you feel they would try to say they owned it. There are ways around having to sign stuff like this. If they tell you that you don't have a job if you don't sign, then that is their call. But they cannot force you into a contract, after the fact, regarding your employment.
  13. Omg, this is so jacked up Dim spriteLocX As Integer = Map(CurrentMap).Token(i).X * PicX Dim halfSpriteWidth As Integer = (SpritesGfxInfo(Map(CurrentMap).Token(i).Sprite).Width / 2) Dim tokenNameWidth As Integer = GetWidth((Trim$(Map(CurrentMap).Token(i).Name))) textX = (ConvertMapX(spriteLocX)) + (halfSpriteWidth) - (tokenNameWidth / 2) It works though. I don't think anyone would have been able to help unless I posted my whole source
  14. Okay, Y axis was easy to solve: textY = ConvertMapY(Map(CurrentMap).Token(i).Y * PicY) - 4 When I just set the X axis to the spriteLocX they ALL draw on the left side: textX = (ConvertMapX(spriteLocX)) So this is half-solved...at least I know the _spritesGfx(i).Size.X is some weird amount that doesn't correlate to the actual width of the token.
  15. This is what it looks like using halfSpriteWidth. I didn't notice it until I put a 96x96 token on there that the Y values are getting off as well: And this with fullSpriteWidth. Apparently this does not work with 96x96: This looks like it is not going to be as easy as I thought it would be, and the entire draw text sub will have to be reworked. Let me know if uploading the whole source will work
  16. This is confusing. Original code to draw text in the center of a 32x32 pixel sprite: textX = ConvertMapX(Map(CurrentMap).Token(i).X * PicX) + (PicX / 2) - GetWidth((Trim$(Map(CurrentMap).Token(i).Name))) / 2 To simplify I have separated the variables. I am using _spritesGfx(i).Size.X instead of PicX, because images can be either 32x32, or 64x64...they can even be larger, I just need the text in the center: Dim spriteLocX As Integer = Map(CurrentMap).Token(i).X * PicX Dim halfSpriteWidth As Integer = (_spritesGfx(i).Size.X / 2) Dim fullSpriteWidth As Integer = (_spritesGfx(i).Size.X) Dim tokenNameWidth As Integer = GetWidth((Trim$(Map(CurrentMap).Token(i).Name))) This works only for 32x32 pixel sprites: textX = (ConvertMapX(spriteLocX) + halfSpriteWidth) - (tokenNameWidth / 2) This works only for 64x64 pixel sprites (I have not tried larger sprites but in theory it should work): textX = (ConvertMapX(spriteLocX) + fullSpriteWidth) - (tokenNameWidth / 2)
  17. Okay, here is what I have so far: After reaching out, both JC and George provided some options for and to using the DPS - thanks a lot guys! So far I am satisfied with what I have working here. It does everything I need it to do (minus a few tweaks). As you can see, using the Dock Panel Suite would really clean up things, making a more updated UI. Currently, on the event that handles the mouse down event for the map window, depending on which tab on the left is selected determines what stuff it will do (i.e. Tiles tab will draw the selected tile, Attributes tab will draw the attributes, Tokens tab will draw the tokens.) I even have it where if it is on the Properties tab, and you click a warp location (cave or door), it will warp you to that map. My question is how do I handle the logic for this type of functionality when using DPS? I can't really loop through which tab is selected, if each tab is its own window. While I strongly feel that adding this functionality into my program will really help out, it may just have to be something I have to pass on...so let me know what ideas you guys have on how this works
  18. No, I fixed my own issue. That one line was preventing me from drawing the fog to the whole screen, except where the tiles were. Now the fog goes across the entire screen like it is supposed to. And that is my new Orion Tabletop app. It is an offline vanilla Orion mod, used for playing tabletop games. Figures can be placed on the screen (with plexi glass) and moved around maps on the secondary screen, controlled by a DM on the primary screen (laptop). Pretty much it is a glorified battlemap to use at a table, and not online...there are a few free online apps already for playing online. I think I am done with it though.
  19. Here was my problem: tmpSprite2.TextureRect = New IntRect(x * 32, y * 32, srcrect.Width, srcrect.Height)
  20. I have turned the fringe2 layer into my fog of war layer. Instead of displaying the tiles on that layer, I am replacing them with a 32 pixel black image instead. Any tiles drawn to this layer will render the black tile regardless of which one is selected. tmpSprite2 is used for displaying a fog texture on top of the black tiles. I don't really want the fog displaying all the time, and I only want it to display over the black tiles on this layer, so I am doing the following: Private Sub DrawFogOfWarTile(ByVal x As Long, ByVal y As Long) Dim srcrect As New Rectangle(0, 0, 0, 0) Dim tmpSprite As Sprite Dim tmpSprite2 As Sprite With Map(CurrentMap).Tile(x, y) If .Layer(MapLayer.FogOfWar).Tileset > 0 And .Layer(MapLayer.FogOfWar).Tileset <= NumTileSets Then ' render With srcrect .X = Map(CurrentMap).Tile(x, y).Layer(MapLayer.FogOfWar).X * 32 .Y = Map(CurrentMap).Tile(x, y).Layer(MapLayer.FogOfWar).Y * 32 .Width = 32 .Height = 32 End With tmpSprite = New Sprite(_fowGfx) tmpSprite.TextureRect = New IntRect(srcrect.X, srcrect.Y, srcrect.Width, srcrect.Height) tmpSprite.Position = New Vector2f(ConvertMapX(x * PicX), ConvertMapY(y * PicY)) tmpSprite.Color = New Color(255, 255, 255, 255) tmpSprite2 = New Sprite(_fogGfx) tmpSprite2.TextureRect = New IntRect(srcrect.X, srcrect.Y, srcrect.Width, srcrect.Height) tmpSprite2.Position = New Vector2f(ConvertMapX(x * PicX), ConvertMapY(y * PicY)) '(x * PicX, y * PicY) tmpSprite2.Color = New Color(255, 255, 255, 255) ' Draw the FoW layer at full opacity so players cannot see ' underneath while the DM can view at half opacity to make changes. If UpdateSecondary = True Then _tmpPlayerWindow.Draw(tmpSprite) _tmpPlayerWindow.Draw(tmpSprite2) End If ' Set the opacity for the DM. tmpSprite.Color = New Color(255, 255, 255, DmEditor.scrlFogOfWar.Value) tmpSprite2.Color = New Color(255, 255, 255, DmEditor.scrlFogOfWar.Value) DmWindow.Draw(tmpSprite, New RenderStates(BlendMode.Alpha)) DmWindow.Draw(tmpSprite2, New RenderStates(BlendMode.Alpha)) tmpSprite.Dispose() tmpSprite2.Dispose() End If End With End Sub This is creating the same greyish looking texture from the fog image, not like I had imagined. So here I am going through all the tiles on the Fringe2/FogOfWar layer, and if there is one anywhere on there, then display the fog over the whole screen: Public Sub DrawFog() Dim ShowFog As Boolean = False Dim currOpacity As Integer = DmEditor.scrlFogOfWar.Value ' Check all the tiles on FogOfWar layer. ' If there is a tile there then this needs to draw fog. For x = TileView.Left To TileView.Right For y = TileView.Top To TileView.Bottom If IsValidMapPoint(x, y) Then If Map(CurrentMap).Tile(x, y).Layer(MapLayer.FogOfWar).Tileset > 0 And Map(CurrentMap).Tile(x, y).Layer(MapLayer.FogOfWar).Tileset <= NumTileSets Then ShowFog = True End If End If Next Next If ShowFog = True Then Dim tmpSprite As Sprite = New Sprite(_fogGfx) tmpSprite.TextureRect = New IntRect(0, 0, tmpSprite.Texture.Size.X, tmpSprite.Texture.Size.Y) 'frmMainGame.GameScreen.Width + 128, frmMainGame.GameScreen.Height tmpSprite.Position = New Vector2f(((DmEditor.picDmScreen.Width / 2) - (tmpSprite.Texture.Size.X / 2)), 0) ' horz - 64 tmpSprite.Color = New SFML.Graphics.Color(255, 255, 255, 255) If UpdateSecondary = True Then _tmpPlayerWindow.Draw(tmpSprite, New RenderStates(BlendMode.Alpha)) End If tmpSprite.Color = New SFML.Graphics.Color(255, 255, 255, currOpacity) DmWindow.Draw(tmpSprite, New RenderStates(BlendMode.Alpha)) tmpSprite.Dispose() End If End Sub I have tried ripping my lighting code to use for this, and instead of checking for attributes I check for tiles, then display the fog. However, the results are horrendous, and each time I place a new tile, the fog displays again, and again, making the screen darker and darker. I'm open to suggestions of how to logically do this because I am out of options that have worked this far. (Please don't say use a render texture, because I have tried that).
  21. There are too few options in the poll. Some of us are on permanent Friday Don't blame me, it's always 5:00 somewhere! XD
  22. Codez Public Sub Render_Graphics() Dim x As Long Dim y As Long If UpdateSecondary = True Then _rt = New RenderTexture(PlayerViewer.playerscreen.Width, PlayerViewer.playerscreen.Height) End If _playerWindow.SetView(New View(New FloatRect(0, 0, MaxMapx * 32, MaxMapy * 32))) _dmWindow.SetView(New View(New FloatRect(0, 0, MaxMapx * 32, MaxMapy * 32))) UpdateCamera() DoEvents() _playerWindow.DispatchEvents() _playerWindow.Clear(Color.Black) _dmWindow.DispatchEvents() _dmWindow.Clear(Color.Black) ' ...draw the stuffs... If Not UpdateSecondary = True Then If _rt Is Nothing Then _rt = New RenderTexture(PlayerViewer.playerscreen.Width, PlayerViewer.playerscreen.Height) _rt.Clear(Color.Black) End If End If _rt.Display() Dim tmpSprite As Sprite = New Sprite(_rt.Texture) tmpSprite.TextureRect = New IntRect(PlayerViewer.playerscreen.Location.X, PlayerViewer.playerscreen.Location.Y, PlayerViewer.playerscreen.Width, PlayerViewer.playerscreen.Height) _playerWindow.Draw(tmpSprite) '_rt) _playerWindow.Display() _dmWindow.Display() UpdateSecondary = False End Sub
  23. Yes, but even with it drawing everytime it is not working. Here is how I planned to check if it needed to be redrawn or not: _playerWindow.SetView(New View(New FloatRect(0, 0, MaxMapx * 32, MaxMapy * 32))) _playerWindow.DispatchEvents() _playerWindow.Clear(Color.Black) If UpdateSecondary = True Then _rt.Clear(Color.Black) ' this same boolean would catch and -rt would be redrawn to... Else ' dont bother clearing it, just redraw the same image. End If _rt.Display() _playerWindow.Draw(_rt) _playerWindow.Display()
  24. Here is what I have: A secondary window that displays the same map as the primary window on an update boolean in the Render_Graphics sub. This works. However, if I have to move the window slightly off screen, or change its size, it will erase some portions. I have created a render texture (_rt) to draw stuff to instead of the player window. In the Render_Graphics sub: _playerWindow.SetView(New View(New FloatRect(0, 0, MaxMapx * 32, MaxMapy * 32))) _playerWindow.DispatchEvents() _playerWindow.Clear(Color.Black) _rt.Clear(Color.Black) '''Draw the same tiles on _rt instead of _playerwindow _rt.Display() _playerWindow.Draw(_rt) _playerWindow.Display() I know I have asked about this in the chatbox, but everytime I look back, the messages are gone, and I seem to be forgetting what I was advised to do so this will work.
  25. Recoil

    Division Of Life 2D

    Talent system looks neat. But I am glad you posted the pic because it reminds me that we need a description panel for our engine
×
×
  • Create New...