Switch to full style
Understanding the language, error messages, etc.
Post a reply

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

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:
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);
      
   
}
Post a reply