![]() |
Utilise cette classe pour contrôler une brique Écran couleur. Plus de détails...
Fonctions membres publiques | |
| def | __init__ (self) |
| Crée un nouvel objet ColoredScreen. Plus de détails... | |
| def | cursor_out_of_screen (self) |
| Vérifie si le curseur est encore sur l'écran. Plus de détails... | |
| def | set_rotation (self, m) |
| Change la rotation de l'écran. Plus de détails... | |
| def | draw_pixel (self, x, y, color) |
| Dessine un pixel. Plus de détails... | |
| def | fill_rect (self, x, y, w, h, color) |
| Remplit un rectangle. Plus de détails... | |
| def | draw_fast_h_line (self, x, y, w, color) |
| Dessine une ligne horizontale. Plus de détails... | |
| def | draw_fast_v_line (self, x, y, h, color) |
| Dessine une ligne verticale. Plus de détails... | |
| def | invert_display (self, i) |
| Inverse les couleurs de l'écran. Plus de détails... | |
| def | color_565 (self, red, green, blue) |
| A partir d'une couleur 24bits retourne une couleur 16bits. Plus de détails... | |
| def | get_cursor_x (self) |
| Récupère la position du curseur sur l'axe x. Plus de détails... | |
| def | get_cursor_y (self) |
| Récupère la position du curseur sur l'axe y. Plus de détails... | |
| def | fill_screen (self, color) |
| Remplit l'écran avec une couleur. Plus de détails... | |
| def | draw_line (self, x0, y0, x1, y1, color) |
| Dessine une ligne. Plus de détails... | |
| def | draw_rect (self, x, y, w, h, color) |
| Dessine un rectangle. Plus de détails... | |
| def | draw_circle (self, x0, y0, r) |
| Dessine un cercle sans le remplir. Plus de détails... | |
| def | fill_circle (self, x0, y0, r, color) |
| Remplit un cercle. Plus de détails... | |
| def | draw_triangle (self, x0, y0, x1, y1, x2, y2, color) |
| Dessine un triangle. Plus de détails... | |
| def | fill_triangle (self, x0, y0, x1, y1, x2, y2, color) |
| Remplit un triangle. Plus de détails... | |
| def | draw_round_rect (self, x, y, w, h, r, color) |
| Dessine un rectangle aux bords arrondis. Plus de détails... | |
| def | fill_round_rect (self, x, y, w, h, r, color) |
| Remplit un rectangle aux bords arrondis. Plus de détails... | |
| def | draw_char (self, x, y, c, color, bg, size) |
| Dessine un caractère. Plus de détails... | |
| def | set_cursor (self, x, y) |
| Change la position du curseur. Plus de détails... | |
| def | set_text_color (self, c) |
| Change la couleur du texte et laisse l'arrière plan transparent. Plus de détails... | |
| def | set_text_size (self, s) |
| Change la taille du texte. Plus de détails... | |
| def | print (self, elem) |
| Affiche un élément à l'écran. Plus de détails... | |
| def | println (self, elem) |
| Affiche un élément à l'écran et retourne à la ligne. Plus de détails... | |
Utilise cette classe pour contrôler une brique Écran couleur.
| def thingz.ColoredScreen.__init__ | ( | self | ) |
Crée un nouvel objet ColoredScreen.
| def thingz.ColoredScreen.color_565 | ( | self, | |
| red, | |||
| green, | |||
| blue | |||
| ) |
A partir d'une couleur 24bits retourne une couleur 16bits.
| red | valeur de rouge (0 = off, 255 = max). |
| green | valeur de vert (0 = off, 255 = max). |
| blue | valeur de bleu (0 = off, 255 = max). |
| def thingz.ColoredScreen.cursor_out_of_screen | ( | self | ) |
Vérifie si le curseur est encore sur l'écran.
| def thingz.ColoredScreen.draw_char | ( | self, | |
| x, | |||
| y, | |||
| c, | |||
| color, | |||
| bg, | |||
| size | |||
| ) |
Dessine un caractère.
| x | Coordonnée la plus en bas à gauche sur l'axe x |
| y | Coordonnée la plus en bas à gauche sur l'axe y |
| c | Le caractère en ASCII |
| color | La couleur à utiliser pour le caractère au format 16-bit 5-6-5 |
| bg | La couleur à utiliser pour l'arrière plan au format 16-bit 5-6-5 (si la même que pour le caractère alors pas d'arrière plan) |
| size | Selection du niveau de taille (1 pour la taille par défaut) |
| def thingz.ColoredScreen.draw_circle | ( | self, | |
| x0, | |||
| y0, | |||
| r | |||
| ) |
Dessine un cercle sans le remplir.
| x0 | Coordonnée du centre du cercle sur l'axe x |
| y0 | Coordonnée du centre du cercle sur l'axe y |
| r | Rayon du cercle |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_fast_h_line | ( | self, | |
| x, | |||
| y, | |||
| w, | |||
| color | |||
| ) |
Dessine une ligne horizontale.
| x | Coordonnée la plus à gauche sur l'axe x |
| y | Coordonnée la plus à gauche sur l'axe y |
| w | Longueur en pixels |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_fast_v_line | ( | self, | |
| x, | |||
| y, | |||
| h, | |||
| color | |||
| ) |
Dessine une ligne verticale.
| x | Coordonnée la plus haute sur l'axe x |
| y | Coordonnée la plus haute sur l'axe y |
| h | Hauteur en pixels |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_line | ( | self, | |
| x0, | |||
| y0, | |||
| x1, | |||
| y1, | |||
| color | |||
| ) |
Dessine une ligne.
| x0 | Coordonnée de départ sur l'axe x |
| y0 | Coordonnée de départ sur l'axe |
| x1 | Coordonnée d'arrivée sur l'axe x |
| y1 | Coordonnée d'arrivée sur l'axe y |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_pixel | ( | self, | |
| x, | |||
| y, | |||
| color | |||
| ) |
Dessine un pixel.
| x | Position horizontale. |
| y | Position verticale. |
| color | color La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_rect | ( | self, | |
| x, | |||
| y, | |||
| w, | |||
| h, | |||
| color | |||
| ) |
Dessine un rectangle.
| x | Coordonnée la plus à gauche sur l'axe x |
| y | Coordonnée la plus à gauche sur l'axe y |
| w | Longueur en pixels |
| h | Hauteur en pixels |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_round_rect | ( | self, | |
| x, | |||
| y, | |||
| w, | |||
| h, | |||
| r, | |||
| color | |||
| ) |
Dessine un rectangle aux bords arrondis.
| x | Coordonnée la plus à gauche sur l'axe x |
| y | Coordonnée la plus à gauche sur l'axe y |
| w | Longueur en pixels |
| h | Hauteur en pixels |
| r | Rayon des coins |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.draw_triangle | ( | self, | |
| x0, | |||
| y0, | |||
| x1, | |||
| y1, | |||
| x2, | |||
| y2, | |||
| color | |||
| ) |
Dessine un triangle.
| x0 | Coordonnée du vertex #0 sur l'axe x |
| y0 | Coordonnée du vertex #0 sur l'axe y |
| x1 | Coordonnée du vertex #1 sur l'axe x |
| y1 | Coordonnée du vertex #1 sur l'axe y |
| x2 | Coordonnée du vertex #2 sur l'axe x |
| y2 | Coordonnée du vertex #2 sur l'axe y |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.fill_circle | ( | self, | |
| x0, | |||
| y0, | |||
| r, | |||
| color | |||
| ) |
Remplit un cercle.
| x0 | Coordonnée du centre du cercle sur l'axe x |
| y0 | Coordonnée du centre du cercle sur l'axe y |
| r | Rayon du cercle |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.fill_rect | ( | self, | |
| x, | |||
| y, | |||
| w, | |||
| h, | |||
| color | |||
| ) |
Remplit un rectangle.
| x | Coordonnée la plus à gauche sur l'axe x |
| y | Coordonnée la plus à gauche sur l'axe y |
| w | Longueur en pixels |
| h | Hauteur en pixels |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.fill_round_rect | ( | self, | |
| x, | |||
| y, | |||
| w, | |||
| h, | |||
| r, | |||
| color | |||
| ) |
Remplit un rectangle aux bords arrondis.
| x | Coordonnée la plus à gauche sur l'axe x |
| y | Coordonnée la plus à gauche sur l'axe y |
| w | Longueur en pixels |
| h | Hauteur en pixels |
| r | Rayon des coins |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.fill_screen | ( | self, | |
| color | |||
| ) |
Remplit l'écran avec une couleur.
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.fill_triangle | ( | self, | |
| x0, | |||
| y0, | |||
| x1, | |||
| y1, | |||
| x2, | |||
| y2, | |||
| color | |||
| ) |
Remplit un triangle.
| x0 | Coordonnée du vertex #0 sur l'axe x |
| y0 | Coordonnée du vertex #0 sur l'axe y |
| x1 | Coordonnée du vertex #1 sur l'axe x |
| y1 | Coordonnée du vertex #1 sur l'axe y |
| x2 | Coordonnée du vertex #2 sur l'axe x |
| y2 | Coordonnée du vertex #2 sur l'axe y |
| color | La couleur à utiliser au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.get_cursor_x | ( | self | ) |
Récupère la position du curseur sur l'axe x.
| def thingz.ColoredScreen.get_cursor_y | ( | self | ) |
Récupère la position du curseur sur l'axe y.
| def thingz.ColoredScreen.invert_display | ( | self, | |
| i | |||
| ) |
Inverse les couleurs de l'écran.
| i | True pour inverser false pour normal |
| def thingz.ColoredScreen.print | ( | self, | |
| elem | |||
| ) |
Affiche un élément à l'écran.
| elem | L'élément à afficher, peut être du texte, un entier, un nombre à virgule |
| def thingz.ColoredScreen.println | ( | self, | |
| elem | |||
| ) |
Affiche un élément à l'écran et retourne à la ligne.
| elem | L'élément à afficher, peut être du texte, un entier, un nombre à virgule |
| def thingz.ColoredScreen.set_cursor | ( | self, | |
| x, | |||
| y | |||
| ) |
Change la position du curseur.
| x | X Coordonnée en pixels |
| y | Y Coordonnée en pixels |
| def thingz.ColoredScreen.set_rotation | ( | self, | |
| m | |||
| ) |
Change la rotation de l'écran.
| m | La rotation à appliquer entre 0 et 3 |
| def thingz.ColoredScreen.set_text_color | ( | self, | |
| c | |||
| ) |
Change la couleur du texte et laisse l'arrière plan transparent.
| c | La couleur à utiliser pour le texte au format 16-bit 5-6-5 |
| def thingz.ColoredScreen.set_text_size | ( | self, | |
| s | |||
| ) |
Change la taille du texte.
| s | taille du texte. 1 taille par défaut: 6x8, 2: 12x16, 3: is 18x24, etc |
1.8.15