Yeah, for now I'm doing a slide kind of thing, thanks for the code, its good stuff. I've done some additions to my original code since posting, and have decided to make the mouse pointer like a little spot light on the 'comic'.
The problem is, that now the pointer doesnt move on to any other selectedObject than the first one, i.e selectedObject = 1.
Should I reset the value? I dunno.
Attached is my code and images and stuff..
Rem ***** Included Source File *****
position camera -1,0,0
point camera 0,0,0
//set dir "C:\Program Files\The Game Creators\Dark Basic Professional\Projects\EfU Times"
`resolution
if (check display mode(800, 600, 32)) = 1
set display mode 800, 600, 32
endif
if (check display mode(1152, 864, 32)) = 1
set display mode 1152, 864, 32
endif
if (check display mode(1280, 1024, 32))=1
set display mode 1280, 1024, 32
endif
`vars
maxPages = 20
moveRate# = 3
Buffer# = 100
sHeight = screen height()
sWidth = screen width()
for i = 1 to maxPages`ticker tape up to 20
If image file exist("page_" + Str$(i) + ".jpg")`if page exists (page_1,2,3...20)
load image "page_" + Str$(i) + ".jpg", i `load (page_1,2,3...20)
make object box i, 1000, 1000, 10 `dimension of the images
position object i, object position x(i) + tempImageSize + Buffer#, 0, 0
texture object i, i
inc tempImageSize, 1000
Endif
next i
`mouse array
dim KP(10,2)
`lighting
make light 1
set spot light 1, 40, 60
`background
load image "background.jpg", 666
draw to back
//debug
//debugSPhere = 999
//make object sphere debugSPhere, 50
//color object debugSPhere, RGB(87,255,87)
do
LMC()
if KP(7,2)=1
selectedObject = pick object(mousex(), mousey(), 1, maxPages)
set cursor object position x(selectedObject), object position y(selectedObject)
position camera object position x(selectedObject), object position y(selectedObject), object position z(selectedObject)-900
point camera object position x(selectedObject), object position y(selectedObject), object position z(selectedObject)
endif
text 10, 10, "Number of Pages: " + (Str$(tempImageSize/1000))
If leftkey() = 1
position camera camera position x() - moveRate# , camera position y(), camera position z()
Endif
If rightkey() = 1
position camera camera position x() + moveRate# , camera position y(), camera position z()
Endif
sprite 1, 0, 0, 666 `bg
if doOnce = 0
size sprite 1, sHeight, sWidth
dooOnce = 1
endif
if (selectedObject <> 0)`not clicked yet? also, not bg image object
position light 1, object position x(selectedObject), object position y(selectedObject), (object position z(selectedObject))-190
//debug
//POSITION object debugSPhere, (mousex()-500), (-mousey()+500), (object position z(selectedObject)-10)
point light 1, (mousex()-500), (-mousey()+500), object position z(selectedObject)
Endif
`**End Loop**
Sync
loop
Function LMC()
`mouseclick()
KP(7,1)=KP(7,0)
KP(7,0)=mouseclick()
`NOT PRESSED
if KP(7,0)=0 and KP(7,1)=0 then KP(7,2)=0
`INITIAL PRESS
if KP(7,0)=1 and KP(7,1)=0 then KP(7,2)=1
`HELD DOWN
if KP(7,0)=1 and KP(7,1)=1 then KP(7,2)=2
`JUST RELEASED
if KP(7,0)=0 and KP(7,1)=1 then KP(7,2)=3
Endfunction