16-bit Fighter
Active member
It's merely a visual aspect for a HUD. Is there a way to make the score right-justified please?
Because isn't on that versionAh you discovered a solution, cool! Could you give me the tip please? I didn't find it in AUBF's 2021 version.
@script
void self = getlocalvar("self"); //Get calling entity.
if(frame==1)
{
char hName = "Jean Grey";
settextobj(1, 240-(strwidth(hName,2)/2), 254, 2, 999999999, hName, 300+openborvariant("elapsed_time"));
}
@end_script
@script
void self = getlocalvar("self"); //Get calling entity.
if(frame==1)
{
char hName = "Jean Grey";
settextobj(1, 240-(strwidth(hName,2)), 254, 2, 999999999, hName, 300+openborvariant("elapsed_time"));
}
@end_script
void writeScore()
{//Draw score using custom font
void player1 = getplayerproperty(0, "entity");
void player2 = getplayerproperty(1, "entity");
void player3 = getplayerproperty(2, "entity");
void player4 = getplayerproperty(3, "entity");
if(!openborvariant("pause")){
WriteFunction(player1, 0);
WriteFunction(player2, 1);
WriteFunction(player3, 2);
WriteFunction(player4, 3);
}
}
void WriteFunction(void player, int pIndex)
{//Script used to reduce code size
//USED FOR PLAYERS ALREADY IN-GAME
if(player != NULL()){
void type = getentityproperty(player, "type");
int exists = getentityproperty(player, "exists");
//DETECTS IF THE DEFINED PLAYER IS IN-GAME AND ALIVE
if(exists){
int score = getplayerproperty(pIndex, "score");
int xPos = 81;
int xDif = 120;
int xAdd = xDif*pIndex;
int yPos = 9;
int font = 1;
int layer = 1001;
drawstring(xPos+xAdd-strwidth(""+score, font), yPos, font, score, layer);
}
}
}