problem with TFT_eSprite
-
Hi all
I have a problem with spritesI have some objects that draw some circels, strings or line to the M5core2.
I do that with the following code
x = 230; uint32_t _r = r; // 50 uint32_t _w = _r * 2; uint32_t _h = _r * 2; TFT_eSprite _sprite = new TFT_eSprite(&M5.Lcd); _sprite.createSprite(_w, _h); _sprite.drawCircle(_r, _r, _r, _color); _sprite.drawCircle(_r, _r, _r - 1, _color); _sprite.fillCircle(_r, _r, _r - 2, _colorCircle); _sprite.pushSprite(x - _r + 4, y - _r + 4); _sprite.deleteSprite();
That works fine if x is lower than 230. As soon x is bigger than 230 every pixel that is outside 280 is trunccatet from the circle
Any ideas or is thre a limitation with sprites?
-
You don't show what Y is, or what your screen orientation is set to. If I remember correctly, if any part of a sprite gets pushed offscreen, the sprite will be truncated. So make sure the bounds of the sprite are within the 320 x 240 pixels of the LCD when you push it. The paramaters to pushSprite are the "upper left corner" of where you want the sprite to be placed.
Look through the examples at https://github.com/m5stack/M5Stack/tree/master/examples/Advanced/Display/Sprite to failiarize yourself.