Posted: 27th Oct 2006 15:21
OK i got to place code here, dont know why it doesnt work when i upload the code:
`This sets up the program
set display mode 1280,800,32
sync on
sync rate 0
`=====================================
remstart
GOSUB LOAD_MEDIA
` ==============================
LOAD_MEDIA: `loading animations in to the program (not on screen yet)
load animation "whatever.gif",1
w=animation width(1)
h=animation height(1)
play animation to image 1,1,0,1,w,h
LOOP ANIMATION 1
load animation "whatever.avi",2
w=animation width(2)
h=animation height(2)
play animation to image 2,2,0,1,w,h
LOOP ANIMATION 2
` ==============================
remend
Grid_TileWidth=5 `Width of the litlle box that follows the mouse
Grid_Tileheight=5 `Height of the litlle box that follows the mouse
` ==============================
Do
cls 0
GRIDS()`call function GRIDS()
remstart
X1=446 `X - position of the first animation
Y1=0 `Y - position of the first animation
SPRITE 2,X1,Y1,2 `Paste first animation on screen
X2=595 `X - position of the seccond animation
Y2=205 `Y - position of the seccond animation
SPRITE 1,X2,Y2,1 `Paste seccond animation on the screen
remend
` ==============================
INK RGB(255,255,0),RGB(0,0,0)
`SETUP MOUSE COORDINATES (for the top left area of the screen)
xpos=mousex()
ypos=mousey()
PRINT ""
PRINT ""
print "X - KOORDINATA = ",xpos `this prints mouse X position on the top left of the screen
print "Y - KOORDINATA = ",ypos `this prints mouse Y position on the top left of the screen
INK RGB(255,0,0),RGB(0,0,0)
X=MOUSEX()
Y=MOUSEY()
SET TEXT OPAQUE
TEXT X-50,Y-50,STR$(MOUSEX())
TEXT X-70,Y-50,"X=" `This prints mouse X position near the mouse cursor
TEXT X-50,Y-25,STR$(MOUSEY())
TEXT X-70,Y-25,"Y=" `This prints mouse Y position near the mouse cursor
` ==============================
remstart
`DISPLAY ANIMATION SIZE
INK RGB(0,255,0),RGB(0,0,0)
AW=ANIMATION WIDTH(1)
AH=ANIMATION HEIGHT(1)
PRINT ""
PRINT ""
PRINT "ANIMATION 1 = ",AW," X ",AH
PRINT ""
AW=ANIMATION WIDTH(2)
AH=ANIMATION HEIGHT(2)
PRINT ""
PRINT ""
PRINT "ANIMATION 2 = ",AW," X ",AH
PRINT ""
remend
` ==============================
`SETUP GRID FOR MOUSE (litlle box)
Grid_Xpos=(xpos/grid_tilewidth)*grid_tilewidth
Grid_Ypos=(ypos/grid_tileheight)*grid_tileheight
Grid_xpos2=Grid_xpos+grid_tilewidth
Grid_ypos2=Grid_ypos+grid_tileheight
` ==============================
box Grid_xpos,Grid_ypos,Grid_xpos2,Grid_ypos2
` ==============================
sync
loop
` ==============================
FUNCTION GRIDS()
`SETTING UP THE GRIDS FOR 1280x800 MELLANRUM=20
`--------------------------------------------------
INK RGB(128,128,128),RGB(0,0,0)
`VERTICAL LINES
A=20 `=20
B=A+A `=40
C=B+A `=60
D=C+A `=80
E=D+A `=100
LINE 0,0,0,799:LINE A,0,A,799:LINE B,0,B,799:LINE C,0,C,799:LINE D,0,D,799
LINE E,0,E,799:LINE E+A,0,E+A,799:LINE E+B,0,E+B,799:LINE E+C,0,E+C,799:LINE E+D,0,E+D,799
LINE E*2,0,E*2,799:LINE E*2+A,0,E*2+A,799:LINE E*2+B,0,E*2+B,799:LINE E*2+C,0,E*2+C,799:LINE E*2+D,0,E*2+D,799
LINE E*3,0,E*3,799:LINE E*3+A,0,E*3+A,799:LINE E*3+B,0,E*3+B,799:LINE E*3+C,0,E*3+C,799:LINE E*3+D,0,E*3+D,799
LINE E*4,0,E*4,799:LINE E*4+A,0,E*4+A,799:LINE E*4+B,0,E*4+B,799:LINE E*4+C,0,E*4+C,799:LINE E*4+D,0,E*4+D,799
LINE E*5,0,E*5,799:LINE E*5+A,0,E*5+A,799:LINE E*5+B,0,E*5+B,799:LINE E*5+C,0,E*5+C,799:LINE E*5+D,0,E*5+D,799
LINE E*6,0,E*6,799:LINE E*6+A,0,E*6+A,799:LINE E*6+B,0,E*6+B,799:LINE E*6+C,0,E*6+C,799:LINE E*6+D,0,E*6+D,799
LINE E*7,0,E*7,799:LINE E*7+A,0,E*7+A,799:LINE E*7+B,0,E*7+B,799:LINE E*7+C,0,E*7+C,799:LINE E*7+D,0,E*7+D,799
LINE E*8,0,E*8,799:LINE E*8+A,0,E*8+A,799:LINE E*8+B,0,E*8+B,799:LINE E*8+C,0,E*8+C,799:LINE E*8+D,0,E*8+D,799
LINE E*9,0,E*9,799:LINE E*9+A,0,E*9+A,799:LINE E*9+B,0,E*9+B,799:LINE E*9+C,0,E*9+C,799:LINE E*9+D,0,E*9+D,799
LINE E*10,0,E*10,799:LINE E*10+A,0,E*10+A,799:LINE E*10+B,0,E*10+B,799:LINE E*10+C,0,E*10+C,799:LINE E*10+D,0,E*10+D,799
LINE E*11,0,E*11,799:LINE E*11+A,0,E*11+A,799:LINE E*11+B,0,E*11+B,799:LINE E*11+C,0,E*11+C,799:LINE E*11+D,0,E*11+D,799
LINE E*12,0,E*12,799:LINE E*12+A,0,E*12+A,799:LINE E*12+B,0,E*12+B,799:LINE E*12+C,0,E*12+C,799:LINE E*12+D-1,0,E*12+D-1,799
`--------------------
`HORIZONTAL LINES
LINE 0,0,1279,0:LINE 0,A,1279,A:LINE 0,B,1279,B:LINE 0,C,1279,C:LINE 0,D,1279,D
LINE 0,E,1279,E:LINE 0,E+A,1279,E+A:LINE 0,E+B,1279,E+B:LINE 0,E+C,1279,E+C:LINE 0,E+D,1279,E+D
LINE 0,E*2,1279,E*2:LINE 0,E*2+A,1279,E*2+A:LINE 0,E*2+B,1279,E*2+B:LINE 0,E*2+C,1279,E*2+C:LINE 0,E*2+D,1279,E*2+D
LINE 0,E*3,1279,E*3:LINE 0,E*3+A,1279,E*3+A:LINE 0,E*3+B,1279,E*3+B:LINE 0,E*3+C,1279,E*3+C:LINE 0,E*3+D,1279,E*3+D
LINE 0,E*4,1279,E*4:LINE 0,E*4+A,1279,E*4+A:LINE 0,E*4+B,1279,E*4+B:LINE 0,E*4+C,1279,E*4+C:LINE 0,E*4+D,1279,E*4+D
LINE 0,E*5,1279,E*5:LINE 0,E*5+A,1279,E*5+A:LINE 0,E*5+B,1279,E*5+B:LINE 0,E*5+C,1279,E*5+C:LINE 0,E*5+D,1279,E*5+D
LINE 0,E*6,1279,E*6:LINE 0,E*6+A,1279,E*6+A:LINE 0,E*6+B,1279,E*6+B:LINE 0,E*6+C,1279,E*6+C:LINE 0,E*6+D,1279,E*6+D
LINE 0,E*7,1279,E*7:LINE 0,E*7+A,1279,E*7+A:LINE 0,E*7+B,1279,E*7+B:LINE 0,E*7+C,1279,E*7+C:LINE 0,E*7+D,1279,E*7+D
LINE 0,E*8-1,1279,E*8-1
ENDFUNCTION
Thanx
Prizmatica