Code Monkey home page Code Monkey logo

tftshape's Introduction

TFTShape

TFTShape is a 2D graphics library designed to work with the Bodmer/TFT_eSPI library which supports SPI-TFT-displays for ESP8266/ESP32 processors. This library is abstracting low level primitives (pixels, lines) to bring them together for use as shape-based 2D drawing functions. It was developed to have an efficient implementation with a low footprint to run with best performance on the target processors. TFTShape has successfully been tested on an ODROID-GO (ILI9341 and ESP32@150MHz Wrover inside).

TFTShape uses, as the name states, a shape based concept. Shapes are containers for groups of vertices which will be interpreted mostly as closed polygons, but depending on the used shape, the vertices can also be single points, open polygons or independent lines. Shapes have all common 2D drawing functions implemented, this includes sizing, translation, rotation, setting a pivot point and filling functions. Shapes can also be used to draw another shape at the position of the parent shape's vertices (grouping).

Following classes and subclasses are available:

  • TFTShape - represents points and closed lines (polygons)
  • TFTLineShape - represents individual lines
  • TFTSplineShape - represents points interpreted as B-splines (open and looped splines)
  • TFTLinestripShape - represent contiguous lines (not closed)
  • TFTShapeBuilder - Factory to create special shapes, ie. grids,splines,stars, n-gons etc.

To have an overview about the various output this library can produce, here are screenshots from the testsuite of the examples directory:

screenshot_20293.png screenshot_35854.pngscreenshot_4572.png screenshot_66902.png screenshot_20320.png screenshot_4554.png screenshot_4598.png screenshot_66925.png screenshot_20260.png screenshot_35807.png screenshot_4559.png screenshot_51345.png screenshot_20266.png screenshot_35845.png screenshot_4564.png screenshot_51372.png screenshot_20287.png screenshot_35853.png screenshot_4571.png screenshot_51387.png

installation

  • Install Bodmer/TFT_eSPI library and make sure examples are running.
  • Download zip and move extraced directory to the arduino libraries folder or use the Library Manager and select install from zip

test

  • From the arduino file menu select examples TFTShape

tftshape's People

Contributors

androdlang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tftshape's Issues

[Feature Request] Line thickness

Excellent job with the library!

From what I have seen, the library currently builds upon single-pixel width line primitives. For future consideration, I'm wondering if you think it might be useful / feasible to consider support for configurable line thickness? Not sure what an optimum algorithm might be; as a hack I wondered if it could be emulated by filled polys...

thanks

How to make a polygon from points?

I am struggling to figure out how to make a polygon from an array of points (that will ultimately come from a json packet). From looking at the code it appears the "ngon" is essentially what I'm looking for but I don't want a standarnd: triangle, rectangle, pentagon etc. I just want to pass in an array of x's and y's and have it draw it. Can you point me in the right direction?

Help

Hello.
I'm dreaming to use "MacBook Pro Touch Bar Volume control" graphics in me project with touch screen. Please see this

.

I'm using TFT-eSPI, this is the best library i think. I'm having no lock to stop the flicker.
I'm using ILI9488 or ILI9341 with capacitive touch, the "Touch" part is fine, no problem, but the
i'm having hard time with graphics, let say moving white slider on top of the gray. This is part of me code

#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();

int x=70, old_x=70, a=1;

void setup(void) {
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);

}
void loop() {
tft.fillRoundRect(65, 190, 345, 45, 7, 0x31C7 );
tft.fillRoundRect(90, 210, (x-60), 8, 1, TFT_BLUE );
tft.fillRoundRect((40+x), 210, (350-x), 8, 1, TFT_WHITE );
x=x+a;
if (x==60 || x==350) {
a = -a;
}
delay(5);
if(old_x!=x){
tft.fillRoundRect((old_x+10), 190, 50, 45, 7, 0x31C7 );
}
tft.fillRoundRect((x+10), 190, 50, 45, 7, 0xFFFF );
old_x=x;
}

So
Please if possible, if you have time help me with this on.
Thank you in advanced !!!

1 pixel top and left border

I'm not sure if this is a bug in TFTShape or a bug in TFT_eSPI or a bug in my code. When I use a ST7735 display on the left and top edges I see a 1 pixel line of random colors.

unnamed

[FIXED] Does not work on M5Stack Grey. ( M5Stack-Core-ESP32 )

I am impressed by this library but have an issue with the library on a M5Stack-Core-ESP32.
It just does not work. No error, no beep.

I made a working clock from the example clock in the demo app. It works beautifully on an M5Stack Fire, but as the title suggests not on the M5Stack Grey.

Anybody else notice this?

Just run the TFTShape example on a Grey to see it not working 8).

EDIT: Add the working clock from the example
Working on a Fire but not a Grey, like the example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.