//-------------------------------------------------
//ObjEffect Functions
//-------------------------------------------------
function ObjEffect_SetAlpha(obj,vertices,alpha){
   let k=0;
   loop(vertices){
      ObjEffect_SetVertexColor(obj,k,alpha,255,255,255);
      k++;
   }
}
function ObjEffect_InitializeRect(texture, layer){
  let obj = Obj_Create(OBJ_EFFECT);
  ObjEffect_SetTexture(obj, texture);
  ObjEffect_SetLayer(obj, layer);
  ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
  ObjEffect_CreateVertex(obj, 4);
  return obj;
}
function ObjEffect_SetXYRect(id, left, top, right, bottom){
  ObjEffect_SetVertexXY(id, 0, left, top);
  ObjEffect_SetVertexXY(id, 1, right, top);
  ObjEffect_SetVertexXY(id, 2, right, bottom);
  ObjEffect_SetVertexXY(id, 3, left, bottom);
}
function ObjEffect_SetUVRect(id, left, top, right, bottom){
  ObjEffect_SetVertexUV(id, 0, left, top);
  ObjEffect_SetVertexUV(id, 1, right, top);
  ObjEffect_SetVertexUV(id, 2, right, bottom);
  ObjEffect_SetVertexUV(id, 3, left, bottom);
}

