a ahhh
ok.
im going to level with you. i got walled in my dungeon keeper game, as i wanted to connect adjacent tiles as 1 room.
however, i was doing this with multiple rooms and the blocks didnt automaticly move to position.
so, again. tilemap.
just have an invisible tilemap on screen. when you release the object, have it snap to position ( or as i did it, just have the shape move with the mouse, but snap to squares (ie, it can only ever cover tilemap squares, cant overlap)
then on release. set the tiles that are covered by the object to become tile 1.
you can do this by comparing the blocks position/tile width so 128,128 will become tile 4,4 (if the tile size is 32)
then. you can use a for each tile condition, and +1 to a global variable for each tile set to 1
this works perfectly for a 1 square block. if its a 3x bloclk, youll have to figure out the calculation to assign 3x tiles
1 more thing to note. set the hit box of the tiles used in the tile map to be slightly smaller than the box, or they can count incorrectly sometimes.
i hope this helps!
if you need me to be specific on anything, let me know. but, i am working on a big project with some people atm.