Thanks unseen your comments make lots sense to me. My editor is graphical. Its simple but this is all that it ia as yet. Have a tinker , some of the co-ords arent correct yet.
REM
DEFLNG A-Z
_TITLE "DukeNukem Editor"
Video& = _NEWIMAGE(800, 600, 32)
Sheet1& = _LOADIMAGE("DNBackground1.bmp", 32)
SCREEN Video&
_FULLSCREEN
DIM SHARED mx%, my%, mbl%, mbr%
Grey& = _RGB32(192, 192, 192)
Pink& = _RGB32(255, 105, 180)
LWhite& = _RGB32(255, 250, 250)
GOSUB Box
GOSUB LoadTiles
_MOUSESHOW
DO
_LIMIT 30
MousePoll
LOCATE 1, 90: PRINT "x="; mx%
LOCATE 2, 90: PRINT "y="; my%
' we in tile paste window
IF mx% >= 8 AND mx% <= 407 THEN
IF my% >= 8 AND my% <= 407 THEN
x% = mx% - 8: y% = my% - 8
xx% = x% \ 16: yy% = y% \ 16
END IF
END IF
' we in tile selection window
IF mx% >= 428 AND mx% <= 684 THEN
IF my% >= 8 AND my% <= 488 THEN
x% = mx% - 428: y% = my% - 8
xx% = x% \ 16: yy% = y% \ 16
IF mbl% = -1 THEN
xxx% = xx% + 1: yyy% = yy% + 1: x1% = (xxx% * 16) - 15: y1% = (yyy% * 16) - 15
LINE ((428 + (xxx% * 16) - 16), (8 + (yyy% * 16)) - 16)-(428 + (xxx% * 16) - 1, 8 + (yyy% * 16) - 1), Pink&, B
_PUTIMAGE (108, 438)-(123, 453), Sheet1&, Video&, ((xxx% * 16) - 15, (yyy% * 16) - 15)-((xxx% * 16) - 1, (yyy% * 16) - 1)
END IF
END IF
END IF
LOCATE 4, 90: PRINT "C="; xx% + 1
LOCATE 5, 90: PRINT "R="; yy% + 1
_DISPLAY
LOOP UNTIL _KEYDOWN(27)
SLEEP
SYSTEM
Box:
LINE (0, 0)-(415, 415), Grey&, BF
LINE (8, 8)-(407, 407), LWhite&, BF
FOR t = 8 TO 398 STEP 16
FOR tt = 8 TO 398 STEP 16
LINE (t, tt)-(t + 15, tt + 15), Pink&, B
NEXT tt
NEXT t
LINE (420, 0)-(690, 496), Grey&, BF
LINE (100, 430)-(132, 462), Grey&, BF
RETURN
LoadTiles:
_PUTIMAGE (428, 8)-(684, 488), Sheet1&, Video&
RETURN
SUB MousePoll ()
DO WHILE _MOUSEINPUT
mx% = _MOUSEX: my% = _MOUSEY: mbl% = _MOUSEBUTTON(1): mbr% = _MOUSEBUTTON(2)
LOOP
END SUB
Needs a lot more work. We got a bit to chew over here at the moment.Link to the graphic
http://dl.dropbox.com/u/10291175/DNBackground1.bmp