<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Core2 and sprites - don&#x27;t play well together?]]></title><description><![CDATA[<p dir="auto">Can anyone tell me if the have sprites working correctly on their Core2 and if so, did you need to do something special to make them work. I don't think there is anything wrong with my code (see below) but the numbers don't overwrite them selves neatly a create quite a mess.<br />
<img src="/assets/uploads/files/1710787914310-img_0041-sharpened-copy-resized.jpg" alt="0_1710787988263_IMG_0041-sharpened copy.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Code:<br />
#include &lt;M5Core2.h&gt;<br />
#include "Bunken20pt7b.h"</p>
<p dir="auto">#define color1 0x2144</p>
<p dir="auto">TFT_eSprite spr = TFT_eSprite(&amp;M5.Lcd);</p>
<p dir="auto">int backlight = 2800;</p>
<p dir="auto">void setup() {</p>
<pre><code>M5.begin();
M5.Axp.SetLcdVoltage(backlight);
spr.createSprite(320,240);
spr.fillSprite(color1);
</code></pre>
<p dir="auto">}</p>
<p dir="auto">void loop() {</p>
<pre><code>M5.update();
backlight = backlight + 1; if (backlight &gt;= 3300) backlight = 0;
//M5.Axp.SetLcdVoltage(backlight);
spr.setTextDatum(4);
spr.setFreeFont(&amp;Bunken20pt7b);
spr.setTextColor(TFT_ORANGE,color1);  
spr.drawString(String(backlight),160,120);
spr.pushSprite(0,0);     
delay(5);
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://community.m5stack.com/topic/6229/core2-and-sprites-don-t-play-well-together</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 07:55:25 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6229.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Mar 2024 18:54:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Core2 and sprites - don&#x27;t play well together? on Mon, 18 Mar 2024 20:09:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/teastain" aria-label="Profile: teastain">@<bdi>teastain</bdi></a> Thanks, that worked like a charm!</p>
]]></description><link>https://community.m5stack.com/post/24434</link><guid isPermaLink="true">https://community.m5stack.com/post/24434</guid><dc:creator><![CDATA[czm88]]></dc:creator><pubDate>Mon, 18 Mar 2024 20:09:15 GMT</pubDate></item><item><title><![CDATA[Reply to Core2 and sprites - don&#x27;t play well together? on Mon, 18 Mar 2024 19:32:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/czm88" aria-label="Profile: czm88">@<bdi>czm88</bdi></a> I use a fill rectangle in the correct size and background colour to clear a text area before each write.<br />
Works a charm on my Core and Core2.</p>
]]></description><link>https://community.m5stack.com/post/24433</link><guid isPermaLink="true">https://community.m5stack.com/post/24433</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Mon, 18 Mar 2024 19:32:07 GMT</pubDate></item></channel></rss>