support 发表于 2022-12-14 11:38:18

三段封装好的显示文本函数拿去用



//| CreateTextLable() function


void CreateTextLable


(string TextLableName, string Text, int TextSize, string FontName, color TextColor, int TextCorner, int X, int Y )


{


//---


   ObjectCreate(TextLableName, OBJ_LABEL, 0, 0, 0);


   ObjectSet(TextLableName, OBJPROP_CORNER, TextCorner);


   ObjectSet(TextLableName, OBJPROP_XDISTANCE, X);


   ObjectSet(TextLableName, OBJPROP_YDISTANCE, Y);


   ObjectSetText(TextLableName,Text,TextSize,FontName,TextColor);


//----


}






//| SetTextLable() function                                          |






void SetTextLable


(string TextLableName, string Text, int TextSize, string FontName, color TextColor, int TextCorner, int X, int Y )


{


//---


   ObjectSet(TextLableName, OBJPROP_CORNER, TextCorner);


   ObjectSet(TextLableName, OBJPROP_XDISTANCE, X);


   ObjectSet(TextLableName, OBJPROP_YDISTANCE, Y);


   ObjectSetText(TextLableName,Text,TextSize,FontName,TextColor);


//----


}






//| TimeCount() function                                          |






void TimeCount


(string TextLableName, int StartNumber, int StopNumber, int Inerval, int TextSize, string FontName, color TextColor, int TextCorner, int X, int Y )


{


//---


   CreateTextLable(TextLableName,"-"+StartNumber+"-",TextSize,FontName,TextColor,TextCorner,X,Y);


   WindowRedraw();


   PlaySound("WAIT");


   for(int Count=StartNumber+1;Count<=StopNumber;Count++)


    {


   Sleep(Inerval);


   PlaySound("WAIT");


   SetTextLable(TextLableName,"-"+ Count+"-",TextSize,FontName,TextColor,TextCorner,X,Y);


   WindowRedraw();


    }


   Sleep(Inerval);


   ObjectDelete(TextLableName);


//----


}


luck88 发表于 2024-1-19 10:00:54

谢谢美女
页: [1]
查看完整版本: 三段封装好的显示文本函数拿去用