Coder Social home page Coder Social logo

Comments (5)

MajicDesigns avatar MajicDesigns commented on August 24, 2024

The sprit animation includes text, not just a sprite, so you will need to animate a " " (space).

You need to set up 2 zones, one for the graphics and one for the text. You can run each zone as per normal Parola animations. The Parola_Sprites_Library example shows how to run a sprite animation. Read https://arduinoplusplus.wordpress.com/2018/04/19/parola-a-to-z-sprite-text-effects/for more info.

If you truly want to mix text and graphics then it will be more complicated. See the example Parola_TG_Combo and the blog post https://arduinoplusplus.wordpress.com/2018/03/29/parola-a-to-z-mixing-text-and-graphics/,

from md_parola.

EdiFirst avatar EdiFirst commented on August 24, 2024

Thank you @MajicDesigns , If I'm not doing wrong I already setup 2 zones:

P.setZone(0, 1, 3); // Set up first 3 displays as Zone 0
P.setZone(1, 0 , 0); // Set up last display as Zone 1
P.displayZoneText(0, message, PA_CENTER, P.getSpeed()*5, P.getPause(), PA_SCROLL_LEFT, PA_SCROLL_LEFT);
P.setSpriteData(1, heart, W_HEART, F_HEART, heart, W_HEART, F_HEART); // Set sprite data for Zone 1

About mixing text and graphics I kind not doing it, once the text is animated in one zone don't affect other zone (of bitmap). Im not sure what happening..

from md_parola.

MajicDesigns avatar MajicDesigns commented on August 24, 2024

setSpriteData() only sets the data for the sprite in the zone. You also need to displayZoneText() using the sprite, as per the blog post article and the examples provided.

from md_parola.

EdiFirst avatar EdiFirst commented on August 24, 2024

Thank you @MajicDesigns yep I realize it later, but ever trying pass the message it are not happening:
P.displayZoneText(1, "", PA_CENTER, P.getSpeed(), P.getPause(), PA_SPRITE, PA_SPRITE);
P.setSpriteData(1, heart, W_HEART, F_HEART, heart, W_HEART, F_HEART);

But I kind find another way, I'm using both libraries:
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
Create a bitmap for instance:
const uint8_t heartBitmap[8] = {0x1c, 0x3e, 0x7e, 0xfc, 0xfc, 0x7e, 0x3e, 0x1c};
A message:
message = "Right Answer!";
and setup both:
mx.begin();
set zones, etc then display message:
P.displayZoneText(0, message, PA_CENTER, P.getSpeed()*2, P.getPause(), PA_SCROLL_LEFT, PA_SCROLL_LEFT);
and Image:
for (uint8_t col = 0; col < 8; col++) {
mx.setColumn(DISPLAY_TO_USE, col, imageToDisplay[col]);
}

That was the best solution, but I believe you could do better for sure.

from md_parola.

MajicDesigns avatar MajicDesigns commented on August 24, 2024

Good to know it works for you.

FYI, you need define the sprite data before you do the animation:

P.setSpriteData(1, heart, W_HEART, F_HEART, heart, W_HEART, F_HEART);
P.displayZoneText(1, "", PA_CENTER, P.getSpeed(), P.getPause(), PA_SPRITE, PA_SPRITE);

I think the libraries will ignore animation when the string is empty ("") as there is nothing to display. You should try a space (" ").

Also, not go practice to declare a new mx object like you did. First blog post referenced above shows how to do it properly.

from md_parola.

Related Issues (20)

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.