/* SlideTexture 2.0 - DMS - July 98 - by Patrick MARTY */ /* SlideTexture 3.0 Client - DMS2 - Apr 99 - by Patrice FAVRE */ typeof class=S;; /* taille des textures dans le moteur 3D */ var fixedX = 256;; var fixedY = 256;; fun slidingObj(a, coord)= let coord -> [x y] in match a with (objAnchor [h m _ _] -> M3shiftTextureXY session h m x y) |(_->nil);; fun slideObj(o,z)= let z->[InitialTempo CurrentTempo x y xe ye nbImgLi nbImgCol t nbX nbY] in ( set t=t+1; if CurrentTempo == nil then set CurrentTempo = InitialTempo else nil; let CurrentTempo -> [sd suite] in if t < (atoi sd) then mutate z<-[_ CurrentTempo _ _ _ _ _ _ t _ _] else ( set nbX=nbX+1; if nbX >= nbImgLi then ( set nbY=nbY+1; if nbY >= nbImgCol then ( apply_on_list ObAnchor o @slidingObj [(x+xe-fixedX) (y+ye-fixedY)]; mutate z<-[_ suite _ _ _ _ _ _ 0 0 0]; ) else ( apply_on_list ObAnchor o @slidingObj [(x+xe) y]; mutate z<-[_ suite _ _ _ _ _ _ 0 0 nbY]; ); ) else ( apply_on_list ObAnchor o @slidingObj [x 0]; mutate z<-[_ suite _ _ _ _ _ _ 0 nbX nbY]; ); ); ); 0;; fun regleTrois (a, b, c) = /* a/b = ?/c */ if a > b then c * (a / b) else if a < b then c / (b / a) else c;; fun newOb(o)= let UgetParam ObUi o "slide" -> [Sx [Sy [SxImg [SyImg tempo]]]] in let atoi Sx -> x in let atoi Sy -> y in let atoi SxImg -> xImg in let atoi SyImg -> yImg in let mod xImg x -> xe in let xImg / x -> nbImgByLi in let mod yImg y -> ye in let yImg / y -> nbImgByCol in let regleTrois fixedX xImg x -> xx in let regleTrois fixedY yImg y -> yy in ObCbAnim o mkfun2 @slideObj [tempo tempo xx yy xe ye nbImgByLi nbImgByCol 0 0 0]; 0;; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;