here is a small part of what I did to end up with the screen shot above
`*** this is for the selling texture ***
function textureBuyer1(Gold,Object,Object_price,Rate,Mx#,My#,Items$,BuyorSell$,hilow1$)
`*** this is for chaning the bit map ***
if image exist(1)>0 then delete image 1
create bitmap 2,640,480
copy bitmap 1,2
set current bitmap 2
`*** left bottom button ***
if mouseclick()=1 and Mx# > 75 and Mx# < 145 and My# > 415 and My# < 450
copy bitmap 4,0,0,270,183,2,75,415,147,450
`*****************
ink rgb(255,255,255),0
set cursor 87,415 : print "Buy"
Swich_On = 1
else
`*** this is what the swich looks like normaly ***
copy bitmap 3,0,0,270,183,2,75,415,147,450
`*****************
ink rgb(0,125,255),0
set cursor 87,415 : print "Buy"
endif
`*** right bottom button ***
if mouseclick()=1 and Mx# > 165 and Mx# < 245 and My# > 415 and My# < 450
copy bitmap 4,0,0,270,183,2,175,415,247,450
`*****************
ink rgb(255,255,255),0
set cursor 179,417 : print "Sell"
Swich_On = 1
else
`*** this is what the swich looks like normaly ***
copy bitmap 3,0,0,270,183,2,175,415,247,450
`*****************
ink rgb(0,125,255),0
set cursor 179,417 : print "Sell"
endif
if mouseclick()=0 then Swich_On = 0
`*** right top button ***
if mouseclick()=1 and Mx# > 175 and Mx# < 247 and My# > 365 and My# < 397
copy bitmap 4,0,0,270,183,2,175,363,247,397
else
copy bitmap 3,0,0,270,183,2,175,363,247,397
endif
`*** left top button ***
if mouseclick()=1 and Mx# > 75 and Mx# < 147 and My# > 365 and My# < 397
copy bitmap 4,0,0,270,183,2,75,363,147,397
else
copy bitmap 3,0,0,270,183,2,75,363,147,397
endif
`*** the big button ***
if mouseclick()=1 and Mx# > 454 and Mx# < 572 and My# > 263 and My# < 314
copy bitmap 4,0,0,270,183,2,454,263,572,314
ink rgb(255,255,255),0
set cursor 467,272 : print "Except"
else
copy bitmap 3,0,0,270,183,2,454,263,572,314
ink rgb(0,125,255),0
set cursor 467,272 : print "Except"
endif
`*** this what is info printed on to the object ***
ink rgb(0,125,255),0
set cursor 65,25 : print BuyorSell$
set cursor 299,77 : print "Raetings ",hilow1$,Rate
set cursor 299,140 : print "Holdeding ",Object
set cursor 65,325 : print Items$
set cursor 300,350 : print "Total ",Object_price
set cursor 300,415 : print "Gold ",Gold
`*** the mouse box ***
ink rgb(0,0,255),0
box Mx#,My#,Mx#+7,My#+7
get image 1,0,0,640,480,1
set current bitmap 0
endfunction Swich_On
`*** this is the start of the gosub ***
Shopitup:
`*** cler the screen ***
x=x+1
if x = 9 then po = 0
if x >= 10 then x=0
``if x = 9 then cls
`*** add more gold ***
if returnkey()=1 then Gold=Gold+1
`*** swich betwene buy sell ***
`Swich_On = 1
`if shiftkey()=1 and buysell = 0 then buysell = 1
if mouseclick()=1 and buysell = 0 then buysell = 1
`*** Sell objects ***
if mouseclick()=1 and Mx# > 165 and Mx# < 245 and My# > 415 and My# < 450
`if buysell = 1
BuyorSell$ = "Selling"
bstime=bstime+1
if bstime >= 100 then bstime = 100
if mouseclick()=1 and Mx# > 165 and Mx# < 245 and My# > 415 and My# < 450 and bstime = 100 then buysell = 2
` if shiftkey()=1 and bstime = 100 then buysell = 2
endif
`*** buy objects ***
if mouseclick()=1 and Mx# > 75 and Mx# < 145 and My# > 415 and My# < 450
`if buysell = 2
BuyorSell$ = "Buying"
bstime = 0
bstime1=bstime1+1
if bstime1 >= 100 then bstime1 = 100
if mouseclick()=1 and Mx# > 75 and Mx# < 145 and My# > 415 and My# < 450 and bstime1 = 100 then buysell = 0
` if shiftkey()=1 and bstime1 = 100 then buysell = 0
endif
`*** re-set buy sell timer ***
if buysell = 0 then bstime1 = 0
`*** use the items up ***
if controlkey()=1 and useitem = 0 then useitem = 1
select useitem
case 1
`*** don't use item
if EnterObject = 0
useitem = 0
uitime = 0
endif
`*** use item poshens ***
if EnterObject = 1 and po = 0
po = 1
uitime=uitime+1
if uitime >= 50 then uitime = 50
if uitime = 50 then Poshen = Poshen - 1 :useitem = 0 :`controlkey()=1 and
if Poshen <= 0 then Poshen = 0
endif
`*** end of case ***
endcase
case default
useitem = 0
endcase
endselect
`*** select Item Number ***
if mouseclick()=1 and Mx# > 175 and Mx# < 247 and My# > 365 and My# < 395 and selectobject1 = 0 then selectobject1 = 1
if selectobject1 = 1
itemseltimer=itemseltimer+1
if itemseltimer >= 5 then itemseltimer = 5
if itemseltimer = 5 then EnterObject=EnterObject+1 :selectobject1 = 0
endif
if mouseclick()=1 and Mx# > 75 and Mx# < 150 and My# > 365 and My# < 395 and selectobject1 = 0 then selectobject1 = 2
if selectobject1 = 2
itemseltimer1=itemseltimer1+1
if itemseltimer1 >= 5 then itemseltimer1 = 5
if itemseltimer1 = 5 then EnterObject=EnterObject-1 :selectobject1 = 0
endif
`*** re-set for the item select ***
if EnterObject <= 0 then EnterObject = 0
if selectobject1 = 0 then itemseltimer = 0 :itemseltimer1 = 0
`*** biying things ***
select EnterObject
`*** start of select ***
`*** object poshen ***
case 1
`*** this is for what item it is and what price ***
Items$ = "Helth Poshen"
Object = Poshen
Object_price = 25
hilow1$ = "+"
Rate = 25
`if spacekey()=1 and po = 0
if mouseclick()=1 and Mx# > 454 and Mx# < 572 and My# > 263 and My# < 314 and po = 0
po = 1
`*** this is for buying items ***
if Gold >= 25 and BuyorSell$ = "Buying"
`Object_price = 25
Gold = Gold - 25 : Poshen = Poshen + 1
if Poshen <= 0 then Poshen = 0
endif
`*** this is for selling itmes ***
if BuyorSell$ = "Selling" and Poshen > 0
`Object_price = 25
Gold = Gold + 25 : Poshen = Poshen - 1
if Poshen <= 0 then Poshen = 0
`Object = Poshen
endif
endif
endcase
`*** object sword ***
case 2
`*** this is for what item it is and what price ***
Items$ = "Basic Sword"
Object = Sword
Object_price = 15
hilow1$ = "+"
Rate = 5
`if spacekey()=1 and po = 0
if mouseclick()=1 and Mx# > 454 and Mx# < 572 and My# > 263 and My# < 314 and po = 0
po = 1
`*** this is for buying items ***
if Gold >= 15 and BuyorSell$ = "Buying"
`Object_price = 15
Gold = Gold - 15 : Sword = Sword + 1
if Sword <= 0 then Sword = 0
endif
`*** this is for selling itmes ***
if BuyorSell$ = "Selling" and Sword > 0
`Object_price = 25
Gold = Gold + 15 : Sword = Sword - 1
if Sword <= 0 then Sword = 0
`Object = Poshen
endif
endif
endcase
`*** object sword ***
case 3
`*** this is for what item it is and what price ***
Items$ = "Gards Sword"
Object = Sword1
Object_price = 25
hilow1$ = "+"
Rate = 10
`if spacekey()=1 and po = 0
if mouseclick()=1 and Mx# > 454 and Mx# < 572 and My# > 263 and My# < 314 and po = 0
po = 1
`*** this is for buying items ***
if Gold >= 25 and BuyorSell$ = "Buying"
`Object_price = 15
Gold = Gold - 25 : Sword1 = Sword1 + 1
if Sword1 <= 0 then Sword1 = 0
endif
`*** this is for selling itmes ***
if BuyorSell$ = "Selling" and Sword1 > 0
`Object_price = 25
Gold = Gold + 25 : Sword1 = Sword1 - 1
if Sword1 <= 0 then Sword1 = 0
`Object = Poshen
endif
endif
endcase
`*** there are no objects in the list ***
case default
Items$ = "No items selected"
Object_price = 0
Object = 0
hilow1$ = ""
Rate = 0
endcase
endselect
`*** end select ***
return
I was thinking using raycasting to find what object your looking at, and get pick distance to work out the camera distance from that object, pick object when object is with in the right distance to the camera, to lock on the object, and pick screen to allow movement of the mouse on screen to interact with the object, this is all a bit on the fly so I can't remember weather I used the right contexts to the code or not so sorry if I haven't.
but the down side to this is that I would have to test to see if the object is facing the right way or not, and I don't have the 1st clue about that, I would think syncing the screen mouse movement to the bitmap mouse movement would be a bit easier.
you could use the camera to zoom in on the object, so you have a better view of the bitmap on the screen, or even turn the camera to face the bitmap on the object, like the camera dose in oblivion when you talk to some one.
The world surcome to the power of an evil god, a new champion arise The dark Lord Sindore
