Takie trudne że aż wcale .-.
class COLOREDPRINT {
var int a8_Alpha; // Anim8(h)
var int a8_Movement; // Anim8(h)
var int tv_Text; // Print(h)
var int vr_Pos;
var int vr_Offs;
};
instance COLOREDPRINT@(COLOREDPRINT);
var int COLOREDPRINT_Act;
var int COLOREDPRINT_COff;
func void COLOREDPRINT_Delete(var COLOREDPRINT this) {
Anim8_Delete(this.a8_Movement);
Print_DeleteText(this.tv_Text);
};
func void COLOREDPRINT_Alpha(var int h, var int value) {
var COLOREDPRINT p; p = get(h);
var zCViewText t; t = get(p.tv_Text);
t.color = ChangeAlpha(t.color, value);
if(COLOREDPRINT_COff > p.vr_Offs) {
p.vr_Pos -= (COLOREDPRINT_COff - p.vr_Offs) * PF_TextHeight;
Anim8(p.a8_Movement, p.vr_Pos, PF_MoveYTime, A8_SlowEnd);
p.vr_Offs = COLOREDPRINT_COff;
};
};
func void COLOREDPRINT_Position(var int h, var int value) {
var COLOREDPRINT p; p = get(h);
var zCViewText t; t = get(p.tv_Text);
t.posY = value;
};
//========================================
// Softprint
//========================================
func void PrintMyText(var string txt, var int color,var int x,var int y,var string font) {
var int h; h = new(COLOREDPRINT@);
var COLOREDPRINT p; p = get(h);
var int v;
v = Anim8_NewExt(1, COLOREDPRINT_Alpha, h, false);
Anim8_RemoveIfEmpty(v, true);
Anim8_RemoveDataIfEmpty(v, true);
Anim8 (v, 255, PF_FadeInTime, A8_Constant);
Anim8q(v, 0, PF_WaitTime, A8_Wait);
Anim8q(v, 0, PF_FadeOutTime, A8_SlowStart);
p.a8_Alpha = v;
v = Anim8_NewExt(y, COLOREDPRINT_Position, h, false);
Anim8 (v, y - PF_TextHeight, PF_MoveYTime, A8_SlowEnd);
p.a8_Movement = v;
p.tv_Text = Print_Ext(x, y, txt, font, color, -1);
p.vr_Pos = y - PF_TextHeight;
COLOREDPRINT_COff += 1;
if(!COLOREDPRINT_Act) {
COLOREDPRINT_COff = 0;
};
COLOREDPRINT_Act += 1;
p.vr_Offs = COLOREDPRINT_COff;
};
//PF_TextHeight,PF_FadeInTime,PF_WaitTime,PF_FadeOutTime - ustawić we własnym zakresie , podglądać w plikach lego
Żebym nawet ja wiedział co należy zrobić, aż się śmiać chce.