...Yet another object effect question.
task Option(ID){
let objoption=Obj_Create(OBJ_EFFECT);
let optionx = 30;
let optiony = 15;
Obj_SetAlpha(objoption,200);
ObjEffect_SetTexture(objoption,img_kogasa);
ObjEffect_SetRenderState(objoption,ALPHA);
ObjEffect_SetPrimitiveType(objoption,PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(objoption,4);
ObjEffect_SetVertexUV(objoption,0,210,162); // four coordinates of orb on spritesheet
ObjEffect_SetVertexUV(objoption,1,226,162); //Assuming 0:LXTY, 1:RXTY, 2:RXBY, 3:LXBY
ObjEffect_SetVertexUV(objoption,2,226,178); //L,eft R,ight T,op B,ottom. Hope correct.
ObjEffect_SetVertexUV(objoption,3,210,178);//DONE
while(!Obj_BeDeleted(objoption)){
optionx = GetPlayerX+optionxrad*cos(optioncount+90*ID);
optiony = GetPlayerY+optionyrad*sin(optioncount+90*ID);
/*ObjEffect_SetVertexXY(objoption,0,Obj_GetX(objoption)-8,Obj_GetY(objoption)-8);
ObjEffect_SetVertexXY(objoption,1,Obj_GetX(objoption)+8,Obj_GetY(objoption)-8);
ObjEffect_SetVertexXY(objoption,2,Obj_GetX(objoption)+8,Obj_GetY(objoption)+8);
ObjEffect_SetVertexXY(objoption,3,Obj_GetX(objoption)-8,Obj_GetY(objoption)+8);*/
ObjEffect_SetVertexXY(objoption,0,optionx-8,optiony-8);
ObjEffect_SetVertexXY(objoption,1,optionx+8,optiony-8);
ObjEffect_SetVertexXY(objoption,2,optionx+8,optiony+8);
ObjEffect_SetVertexXY(objoption,3,optionx-8,optiony+8);
Obj_SetPosition(objoption, optionx, optiony);
ObjEffect_SetAngle(objoption, 0, 0, Obj_GetAngle(objoption)+1);
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
//Focused option shot below
if(count%6 == 3){
CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 15, 270, 2, 1, 18);
CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 8, 270, 2, 3, 23);
}
}else{
if(count%8 == 4){
CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 15, 270, 2, 1, 18);
CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 8, 270, 2, 3, 23);
}
} //closes the if else
yield;
}
}
Basically, I have four options that are *supposed* to rotate around the player in an elliptical path. The positioning is correct, since the shots were created at the correct location, but the graphics float towards the lower left corner, and are only close to the player when in the top left corner of the screen.
This ObjEffect_SetVertexXY problem has probably been answered before. However, I've tweaked it many times and it refuses to work correctly.
If anyone can provide an answer, I'd be truly grateful.
Sorry for posting something that has probably been answered already.
Edit: If the problem has to do with the ID, then I can fix that when it comes to the XY coordinates. However, everywhere I look, there's a different way to use XY.
I'm going to dig around for Drake's last answer to my questions and see if that answers it.