Hello Guest

Author Topic: Tilemap Painting  (Read 6349 times)

Darkfirewolf5

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Tilemap Painting
« on: February 02, 2014, 04:13:01 am »
Tilemap painting,

Tried to find information about the tile map painting with edge detection was not able to find anything on that at all or how to work it,

Also want to know when we will have painting for tilemap that isnt rectangle base painting, I mean painting much like MS Paint or such, it would make map creation alot easier

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Painting
« Reply #1 on: February 03, 2014, 11:11:45 am »
tk2d doesn't do ms paint style painting - thats not suited for a tile map editor. Tilemaps are just repeated sprites. While you could make them really really small, it would kinda defeat the purpose.

Darkfirewolf5

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Painting
« Reply #2 on: February 05, 2014, 11:29:47 pm »
Sorry,

I dont think I explained it too well, I am talking about the placing of tiles, I dont like the box style placing, I want to be able to left click and hold it and move the move to paint tiles instead of making a giant rectagle, painting the selected tiles to the tilemap ATM is not that great,

Essentially I do NOT want to place tiles by doing a rectangular type box painting.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Painting
« Reply #3 on: February 06, 2014, 01:28:36 am »
We had this as an option way back but couldn't fit it in the UI anywhere without cluttering it up further. You can enable it locally by patching the following lines in tk2dTileMap.cs -

            if (Event.current.type == EventType.MouseDrag && GUIUtility.hotControl == controlID)
            {
               UpdateCursorPosition();
               UpdateWorkingBrush();
               if (editorData.editMode == tk2dTileMapEditorData.EditMode.Paint) {
                  PencilDrag();

                  RectangleDragEnd();
                  RectangleDragBegin();
                  cursorX0 = cursorX;
                  cursorY0 = cursorY;

               }
               if (editorData.editMode == tk2dTileMapEditorData.EditMode.Color) {

Darkfirewolf5

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Painting
« Reply #4 on: February 06, 2014, 02:56:02 am »
Thanks for that info,

I tried finding where to put it in that file but i didn't find any of that code, I wasnt able to find it, could it be added back in the future updates like maybe when you click the pencil icon and hold it, it will bring up more options and you can select it much like how Photoshop's UI is, thanks for the help though!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Painting
« Reply #5 on: February 06, 2014, 09:16:06 am »
Sorry, I typed the wrong filename there... its tk2dTileMapSceneGUI.cs, around line 631 or so.

That sorta click & hold functionality would be ideal, but it would mean writing a control just for this and that would take away time from probably more useful features. We had this as a modifier before, where any operation that could use rectangles could use single tile painting too, but it was far too confusing.

Darkfirewolf5

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Painting
« Reply #6 on: February 06, 2014, 04:16:54 pm »
 :'(

Sorry I dont mean to sound so help less, but I have looked over the code and I just cant seem to locate that file you listed...I feel dumb

Edit: edit i am done finally found it..
« Last Edit: February 06, 2014, 04:20:26 pm by Darkfirewolf5 »

Darkfirewolf5

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Painting
« Reply #7 on: February 06, 2014, 04:42:23 pm »
So I just hacked this together,

                  if(usePaintStyle == true)
                  {
                     RectangleDragEnd();
                     RectangleDragBegin();
                     cursorX0 = cursorX;
                     cursorY0 = cursorY;
                  }



........
            case 'g':
               ev.Use();
               if(usePaintStyle)
               {
                  usePaintStyle = false;
               }
               else
               {
                  usePaintStyle = true;
               }
               break;


Is what I did, so far it is working great! Thanks :)