srry, i was in a hurry. entire code:
LX = 640
LY = 480
DIM index$(65535,7)
COUNTER = 0
LOAD IMAGE "build_menu.bmp" , 1
goto begin
begin:
DO
ox = x
oy = y
x = mousex()
y = mousey()
c = mouseclick()
if c = 1
x = mousex()
y = mousey()
line ox,oy,x,y
if x > bx then bx = x
if x < lx then lx = x
if y > by then by = y
if y < ly then ly = y
mx = ((bx-lx)/2)+lx : my = ((by-ly)/2)+ly
endif
if c=2 : dot mx,my
`line bx,ly,lx,ly
`line lx,by,lx,ly
`line bx,by,bx,ly
`line bx,by,lx,by
gosub LABEL
goto begin : endif
LOOP
LABEL:
line lx, by+12, lx, by+132
line lx, by+12, lx+100, by+12
line lx+100, by+12, lx+100, by+132
line lx, by+132, lx+100, by+132
line lx, by+42, lx+100, by+42
line lx, by+72, lx+100, by+72
line lx, by+102, lx+100, by+102
Center Text lx+50, by+27, "Residential"
Center Text lx+50, by+57, "Commercial"
Center Text lx+50, by+87, "Industrial"
Center Text lx+50, by+117, "Road"
create bitmap 1,640,480
set current bitmap 1
paste image 1,lx,by+12
while mouseclick() = 1
c = mouseclick()
x = mousex()
y = mousey()
col = point(x,y)
if col = rgb(255,0,0) then type$ = "R"
if col = rgb(0,255,0) then type$ = "C"
if col = rgb(0,0,255) then type$ = "I"
if col = rgb(255,0,255) then type$ = "R"
endwhile
Counter = Counter + 1
index$(counter,1) = str$(lx)
index$(counter,2) = str$(ly)
index$(counter,3) = str$(mx)
index$(counter,4) = str$(my)
index$(counter,5) = str$(bx)
index$(counter,6) = str$(by)
index$(counter,7) = type$
lx = 640
mx = 0
bx = 0
ly = 480
my = 0
by = 0
type$ = ""
set current bitmap 0
return
screenie of wat im sayin below
oh, and how can i get the menu to go away?
[edit] fixed.!!! i made the menue into sprite and made a few other small changes to make it wait in apropriate spots and its working flawlessly.
almost.
all code:
LX = 640
LY = 480
DIM index$(65535,7)
COUNTER = 0
LOAD IMAGE "build_menu_00.bmp",1
LOAD IMAGE "build_menu_01.bmp",2
goto begin
begin:
DO
ox = x
oy = y
x = mousex()
y = mousey()
c = mouseclick()
if c = 1
x = mousex()
y = mousey()
line ox-1,oy-1,x-1,y-1 : line ox,oy-1,x,y-1 : line ox-1,oy-1,x-1,y-1
line ox-1,oy,x-1,y : line ox,oy,x,y : line ox-1,oy,x-1,y
line ox-1,oy+1,x-1,y+1 : line ox,oy+1,x,y+1 : line ox-1,oy+1,x-1,y+1
if x > bx then bx = x
if x < lx then lx = x
if y > by then by = y
if y < ly then ly = y
mx = ((bx-lx)/2)+lx : my = ((by-ly)/2)+ly
endif
if c=2
`dot mx,my
`line bx,ly,lx,ly
`line lx,by,lx,ly
`line bx,by,bx,ly
`line bx,by,lx,by
gosub LABEL
goto begin : endif
LOOP
LABEL:
sprite 1,lx,by+12,1
show sprite 1
create bitmap 1,640,480
set current bitmap 1
paste image 2,lx,by+12
repeat
until mouseclick() = 1
while mouseclick() = 1
c = mouseclick()
x = mousex()
y = mousey()
col = point(x,y)
print col
if col = rgb(255,0,0) then type$ = "R"
if col = rgb(0,255,0) then type$ = "C"
if col = rgb(0,0,255) then type$ = "I"
if col = rgb(255,0,255) then type$ = "S"
endwhile
Counter = Counter + 1
index$(counter,1) = str$(lx)
index$(counter,2) = str$(ly)
index$(counter,3) = str$(mx)
index$(counter,4) = str$(my)
index$(counter,5) = str$(bx)
index$(counter,6) = str$(by)
index$(counter,7) = type$
set current bitmap 0
center text mx,my-6,type$
lx = 640
mx = 0
bx = 0
ly = 480
my = 0
by = 0
type$ = ""
repeat
until mouseclick() = 0
hide sprite 1
set current bitmap 1
cls
set current bitmap 0
return
when i try to make a commercial building it doesn't print the label. im not sure if the problem is in the menu or in the labeler.