azkanan Posted April 4, 2013 Author Share Posted April 4, 2013 Hey guys.I want to make it so that when a player clicks on the grid, a square of colour will show up where he clicked, the colour being dependent on what the player chose from the list on the left - as the lift will contain rooms that act as a key for colours placed down.I'm a total newbie when it comes to graphics, so I haven't a clue on this subject. Any help as to how to draw a new image (a square colour) and for it to find where to be placed, snapping with the grid (where the mouse clicked), would be much appreciated.![](http://puu.sh/2tI3J.png)Regards,Azkanan Link to comment Share on other sites More sharing options...
Whackeddie99 Posted April 4, 2013 Share Posted April 4, 2013 Write colors on that list on the left, then whenever its clicked link it to a RBGA color code. I'm not sure if that is a table or what on the right, but you'd either need to draw with directx the color and box over the space you click, or just set the color in the grid options to the hex code (instead of RBGA) of the color you have selected Link to comment Share on other sites More sharing options...
azkanan Posted April 4, 2013 Author Share Posted April 4, 2013 > Write colors on that list on the left, then whenever its clicked link it to a RBGA color code. I'm not sure if that is a table or what on the right, but you'd either need to draw with directx the color and box over the space you click, or just set the color in the grid options to the hex code (instead of RBGA) of the color you have selectedIt's just a picture box with a grid image I drew. Link to comment Share on other sites More sharing options...
tslusny Posted April 4, 2013 Share Posted April 4, 2013 Use BitBlt for it. Or look at how is selection box in EO 2.0 in map editor handled Link to comment Share on other sites More sharing options...
azkanan Posted April 4, 2013 Author Share Posted April 4, 2013 I'm looking at the source code for the map editor, and I'm all, whut. I never liked coding in VB6 because of how decentralised all the code is. There's no notations saying where or what "x" and "y" is. It just refers to it in the Call.```Private Sub picBackSelect_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call MapEditorChooseTile(Button, x, y) ' Error handler Exit Suberrorhandler: HandleError "picBackSelect_MouseDown", "frmEditor_Map", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Leads to…```Public Sub MapEditorChooseTile(Button As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If Button = vbLeftButton Then EditorTileWidth = 1 EditorTileHeight = 1 EditorTileX = x \ PIC_X EditorTileY = y \ PIC_Y frmEditor_Map.shpSelected.top = EditorTileY * PIC_Y frmEditor_Map.shpSelected.Left = EditorTileX * PIC_X frmEditor_Map.shpSelected.width = PIC_X frmEditor_Map.shpSelected.height = PIC_Y End If ' Error handler Exit Suberrorhandler: HandleError "MapEditorChooseTile", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
Whackeddie99 Posted April 4, 2013 Share Posted April 4, 2013 I could do it for you if you wanted Link to comment Share on other sites More sharing options...
azkanan Posted April 5, 2013 Author Share Posted April 5, 2013 > I could do it for you if you wantedWould be much appreciated. I can learn from it then. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) 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