On which the port and pin I connects serial communication between PC and PIC
I have used rx2/tx2 (the code could be altered to use tx1/rx1)

What is the maximum number of buttons possible to make the TFT screen.
this is the limiting factor
button_flg VAR BYTE ;1 BIT PER BUTTON make it a word to have up to 16 buttons




I tried to make a four keys and the fourth button is not working. The first three are working.
button state is not defined when buttons are created easiest solution is to insert a clear command



Code:
        INCLUDE "TFT_SPI.pbpmod"        ;glcdc
        include "tft-ILI9431.bas" 
        'INCLUDE "flash_spi.pbpmod"

        include "TOUCH_TFT.PBPMOD"      ;uncomment  to use TOUCH_TFT
        INCLUDE "font7x8.bas"
    latb=255   ;  make sure tft etc are not selected ie all cs high
    TRISA=111111
    TRISB=000011    
    TRISC=010011
    TRISD=000000
    PORTD=0000000

    OSCCON = 110000         'Internal 8 Mhz Osc 
    OSCTUNE=000000        'PLL ON

   clear

    cont=500               ;half brightness
    DEFINE OSC 32
    buff var byte[32]
    t2con=5
    PR2 = 255; 
    CCPR1L = cont>>2;             ;set pwm
    ccp1con=12|((cont&3)<<4);
    SSPCON1=$20  ;$20-21-22 works 20 IS FASTEST
how I can change color of screen wallpaper from black to yellow
the screen colour has two properties fg (foreground) bg (background)
set them as you like

use fg=bg and fillrect to clear an area

how I can changes color of buttons from red to green and how to change color of outline on buttons
button_scheme var word[4] ; [background,text,border,animated (background or border) ]

defaults
button_scheme[0]= $1f
button_scheme[1]= $0
button_scheme[2]= $7ff
button_scheme[3]= $ffff

buttons can have different animations too
button_action.0[1]=1 ;flash text for this button1
button_action.0[2]=0 ;flash outline for this button2 ; default action