Modifications

Sauter à la navigation Sauter à la recherche
353 octets ajoutés ,  17 septembre 2018 à 16:08
Ligne 212 : Ligne 212 :  
==== Icon ====
 
==== Icon ====
 
Il est assez facile de créer et afficher une icône.
 
Il est assez facile de créer et afficher une icône.
 +
 +
La fonction `draw_icon()`.
 +
 +
<syntaxhighlight lang="python">def draw_icon( lcd, from_x, from_y, icon ):
 +
    for y, row in enumerate( icon ):
 +
        for x, color in enumerate( row ):
 +
            if color==None:
 +
                continue
 +
            lcd.pixel( from_x+x,
 +
                      from_y+y,
 +
                      color )
 +
</syntaxhighlight>
    
Mise en place en dessinant une croix noir sur fond blanc.
 
Mise en place en dessinant une croix noir sur fond blanc.
29 917

modifications

Menu de navigation