Got it, popup fixed for Gamebuino AP library (GameR)

Understanding the language, error messages, etc.

Got it, popup fixed for Gamebuino AP library (GameR)

Postby Duhjoker » Sat Nov 18, 2017 2:46 am

I got to the point in my dune game that I really needed the popup to work. So I got up today and decided that I'm gonna get it working. For some reason the teensy library didn't like the timer feature part of the function. I don't think the t3x has the clock crystals built in which could account for that but is just conjecture. let me tell you though I put update popup in the updateAll function and placed it and update popup in my code in several places but nothing.

So today out of curiosity I wrote the two functions in to one. Nothing so I removed the timer stuff and retried. Bingo!!!! when ever I would touch something with a popup added I would get words on the top of the screen real tiny. Next I made my own text bubble and added it. Bingo again. I didn't like that the function had a set placement and size on screen in the function. So I fixed that as well. Now you add the text sixe and cursor position when you call the function. Also it pops up only when touching the object walk away and it goes away!!!

Code: Select all
void GrafxT3::Popup(const __FlashStringHelper* text, uint8_t s, int16_t x, int16_t y){
       popupText = text;
          textsize = (s > 0) ? s : 1;
      
          fillRoundRect(0,0,320,60,4,BLUE);
          drawRoundRect(0,0,320,60,4,WHITE);

             if (x < 0) x = 0;
       else if (x >= _width) x = _width - 1;
       cursor_x = x;
            if (y < 0) y = 0;
       else if (y >= _height) y = _height - 1;
       cursor_y = y;
      print(popupText);
      
   
}
Fear is the mind killer......
User avatar
Duhjoker
 
Posts: 445
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron