////////////////////////////////////////////////////////////////////////////////////
//Background Index// Template From MCXD Scripts//
////////////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////////
//Function Index///////////////////////////////////////////////////////////////////
//////////////////////////////
let offs1 = 0; 
let offs2 = 0; 
let offs1b = 0; 
let offs2b = 0; 
let offs3 = 0; 
let offs3b = 0; 
let alppla=255;

function BgScroll(bg, hdir, vdir){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicRect(0+offs1, 0+offs2, 384+offs1, 448+offs2);
   DrawGraphic(GetCenterX, GetCenterY);
   offs1+=hdir;
   offs2+=vdir;
   }

function BgSpin(bg, spe){
   SetTexture(bg);
   SetGraphicAngle(0, 0, offs3);
  SetGraphicScale(1.5, 1.5);
   SetGraphicRect(0, 0, 512, 512);
   DrawGraphic(GetCenterX, GetCenterY);
   offs3+=spe;

   SetGraphicAngle(0, 0, 0);
   }

function BgScrollEx(bg, hdir, vdir, scale, alpha){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicScale(scale, scale);
   SetAlpha(alpha);
   SetGraphicRect(0+offs1, 0+offs2, 512+offs1, 512+offs2);
   DrawGraphic(GetCenterX, GetCenterY);
   offs1+=hdir;
   offs2+=vdir;

   SetGraphicScale(1, 1);
   SetAlpha(255)
   }
function BgScrollEx1(bg, hdir, vdir, scale, alpha){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicScale(scale, scale);
   SetAlpha(alpha);
   SetGraphicRect(0+offs1, 0+offs2, 384+offs1, 448+offs2);
   DrawGraphic(GetCenterX, GetCenterY);
   offs1+=hdir;
   offs2+=vdir;

   SetGraphicScale(1, 1);
   SetAlpha(255)
   }
function BgScrollEx2(bg, hdir, vdir, scale, alpha){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicScale(scale, scale);
   SetAlpha(alpha);
   SetGraphicRect(0+offs1b, 0+offs2b, 512+offs1b, 512+offs2b);
   DrawGraphic(GetCenterX, GetCenterY);
   offs1b+=hdir;
   offs2b+=vdir;

   SetGraphicScale(1, 1);
   SetAlpha(255)
   }

function BgSpinEx(bg, spe, scale, alpha){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicAngle(0, 0, offs3);
   SetGraphicScale(scale, scale);
   SetAlpha(alpha);
   SetGraphicRect(0, 0, 512, 512);
   DrawGraphic(GetCenterX, GetCenterY);
   offs3+=spe;

   SetGraphicAngle(0, 0, 0);
   SetGraphicScale(1, 1);
   SetAlpha(255)
   }

function BgSpinEx2(bg, spe, scale, alpha){
   SetTexture(bg);
   SetGraphicAngle(0, 0, 0);
   SetGraphicAngle(0, 0, offs3b);
   SetGraphicScale(scale, scale);
   SetAlpha(alpha);
   SetGraphicRect(0, 0, 512, 512);
   DrawGraphic(GetCenterX, GetCenterY);
   offs3b+=spe;

   SetGraphicAngle(0, 0, 0);
   SetGraphicScale(1, 1);
   SetAlpha(255)
   }


sub BgResetData{
   offs1=0;
   offs2=0;
   offs1b=0;
   offs2b=0;
   offs3=0;
   offs3b=0;}
