Game
-
Can someone explain to me how I can create a program which can have 16 tiles, each with a separate picture/image, and the user can then move the tiles around to form a 4 * 4 square. Each tile can have the image rotated by 90 degrees clockwise or 180 degrees clockwise. If the tiles could automatically stick to each other when they get close, so that each tile is set to the same hight as it's neighbour that would be great. Sorry, if this sounds quite easy, but I have don't do much graphics work normally. Cheers :-D
-
Can someone explain to me how I can create a program which can have 16 tiles, each with a separate picture/image, and the user can then move the tiles around to form a 4 * 4 square. Each tile can have the image rotated by 90 degrees clockwise or 180 degrees clockwise. If the tiles could automatically stick to each other when they get close, so that each tile is set to the same hight as it's neighbour that would be great. Sorry, if this sounds quite easy, but I have don't do much graphics work normally. Cheers :-D
-
Can someone explain to me how I can create a program which can have 16 tiles, each with a separate picture/image, and the user can then move the tiles around to form a 4 * 4 square. Each tile can have the image rotated by 90 degrees clockwise or 180 degrees clockwise. If the tiles could automatically stick to each other when they get close, so that each tile is set to the same hight as it's neighbour that would be great. Sorry, if this sounds quite easy, but I have don't do much graphics work normally. Cheers :-D
Don't know if you got your answer yet, but I came across an example in the book VI6 Unleashed. It isn't exactly the solution, but it demonstrates moving graphics around and locking them into place. I don't think there is an IP issue sharing this with you. I also don't know how to attach a file, so here is the source for the page in in line: (Graphics files obviously missing.) I hope it helps. Flags of Canada <!-- beingdragged = "" theid="" sub domousedn theid = window.event.srcElement.id ' if left(theid,4) = "text" then beingdragged = "" else beingdragged = theid end if end sub sub domousemv if window.event.X < 45 then beingdragged="" end if if window.event.Y < 34 then beingdragged="" end if if beingdragged <> "" then ' document.all(beingdragged).style.pixelLeft = window.event.x - 45 document.all(beingdragged).style.pixelTop = window.event.y - 34 call checkpos end if window.event.cancelBubble = true window.event.returnValue = false end sub sub checkpos() textname="text" & beingdragged if (document.all(beingdragged).style.pixelLeft > document.all(textname).style.pixelLeft - 10 AND _ document.all(beingdragged).style.pixelLeft < document.all(textname).style.pixelLeft + 10) _ and _ (document.all(beingdragged).style.pixelTop > document.all(textname).style.pixelTop - 10 AND _ document.all(beingdragged).style.pixelTop < document.all(textname).style.pixelTop + 10) THEN document.all(beingdragged).style.pixelLeft = document.all(textname).style.pixelLeft document.all(beingdragged).style.pixelTop = document.all(textname).style.pixelTop document.all(beingdragged).filters.alpha.opacity=50 document.all(textname).style.visibility="hidden" beingdragged="" end if end sub sub domouseup if beingdragged <> "" then ' document.all(beingdragged).style.zIndex = 0 beingdragged = "" window.event.cancelBubble = true window.event.returnValue = false end if end sub '--> <!-- sub document_onmousedown call domousedn end sub sub document_onmousemove call domousemv end sub sub document_onmouseup call domouseup end sub -->