Ben tu design bien mieux les fonctions que mio, mais par exemple, hier, j'ai eu besoin d'afficher du texte en blanc, j'ai du écrire ça :
move.l HelpTextPtr(%fp),%d3 |any help text to print ?
beq.s NoString |no, continue
clr.w -(%sp) |font : 0
move.l %d3,-(%sp) |&string
RC DrawStrWidth |get string lenght in pixels
move.w LcdHeight(%fp),%d4
subi.w #28,%d4 |y
move.w HelpTextCoord(%fp),%d5 |get its abcisse
sub.w %d0,%d5 |sub string lenght
bpl.s NotNegative |<0 ?
moveq.l #1,%d5 |else adjust it
NotNegative:
move.l #239<<16+127,(%sp) |screen size
move.l CurrentDScreen(%fp),-(%sp) |first plane
RC PortSet |redirect functions
move.w #3,(%sp) |color
move.l %d3,-(%sp) |&string
move.w %d4,-(%sp) |y
move.w %d5,-(%sp) |x
RC DrawStr |print it
move.l #239<<16+127,(%sp) |screen size
move.l CurrentDScreen(%fp),-(%sp) |first screen
addi.l #3840,(%sp) |second one
RC PortSet |redirect functions
move.w #3,(%sp) |color
move.l %d3,-(%sp) |&string
move.w %d4,-(%sp) |y
move.w %d5,-(%sp) |x
RC DrawStr |print it
lea.l 30(%sp),%sp |fix stack
Alors qu'un attribut couleur dans genlib:
ut_small_string aurait suffit.
Une autre fois, j'ai fait une "intro" avec un texte défilant de bas en haut, dans plusieurs fontes. A cause du manque de clipping et de couleur, c'était plutôt galère : afficher le texte dans un buffer, le transformer pour n'avoir qu'à le orer sur le screen, faire le clipping etc... Bref, dès qu'on veut du texte en-dehors du bon gros texte en plein milieu dont on connait la longeur exact, c'est rigolo.