This library is designed to be an extension to Henning Karlsen's UTFT and UTouch libraries. Essentially it is quite similar to his newer UTFT_Buttons library, because it itself has its own button types. Most of these button types have two ways of getting the touch data and that is either from the Raw touch points which are gotten from using myTouch.TP_X / myTouch.TP_Y, or the calculated touch points from the getX() and getY() functions. The reason I implemented these two different ways is because under certain circumstances, one way is faster than the other.
These types are:
• Touch button (Rectangle/ Circle /Triangle) : Able to have centered text
• Latching button (Rectangle/ Circle/ Triangle) : Able to have centered text
• Touch Delay button (Rectangle/ Circle/ Triangle)
• Radio buttons (Rectangle and Circle) : Able to have centered text
• Touchable sliders (Horizontal and Vertical)
• Keyboard (Standard and Mobile)
Using the raw myTouch.TP_X/Y is technically faster because it does not require the user to calibrate the screen or worry about touch precision, but it does require the user to manually map the boundaries of the screen and the use of the map function. However the getX/Y functions do not require such hassling work, but they do require the screen to be calibrated and certain variables in the .cpp file to be changed. The getX/Y functions also need to be set to a precision setting, as either Low, Medium, Hi or Extreme. Low is the fastest of the four settings, because it requires minimal calculations to be done per touch, but it is not as precise; whereas Extreme has the highest touch precision but it takes a lot more time to calculate per touch thereby slowing down the processor from other tasks.
• TouchButton / TouchCircle / TouchTriangle:
• Latchbutton / LatchCircle / LatchTriangle:
*Just like the touch button and touch circle functions, they too can be any size and orientation, but this type button will need its own identification number. The current maximum allowed is 10 but this can be changed in the TFT_Extension.h file, Num_Of_Buttons 10.
** These buttons can have centered text by entering the text into the SetLatch(Button/Circle/Triangle) Text functions
• TouchDelayButton / TouchDelayCircle / TouchDelayTriangle:
• TextButton: (Replaced by both SetTouchButtonText and SetLatchButtonText)
• RadioButton / RadioCircleButton:
TouchButton _Draw/ TouchCircle_Draw / TouchTriangle_Draw: All three are nearly identical to their counterparts TouchButton, TouchCircle and TouchTriangle, but these require an ID number to work. These type of buttons also need to be colored, told whether they should be rounded or not, and filled or not. This is done with the corresponding functions, SetTouchButtonColors, SetTouchCircleColors and SetTouchTriangleColors. Note: Circles do not have the option to be rounded, because they are already round XD LatchButton _Draw/ LatchCircle_Draw / LatchTriangle_Draw: See "Latchbutton / LatchCircle / latchTriangle:" for description Again, these type of buttons also need to be colored, told whether they should be rounded or not, and filled or not. This is done with the corresponding functions, SetLatchButtonColors, SetLatchCircleColors and SetLatchTriangleColors.
Resetting The Buttons All the _Draw functions are able to be reset when switching screens or using a menu system. They can either be reset individually or by all of the same type. ResetTouchButton(byte ID); ResetTouchCircle(byte ID); ResetTouchTriangle(byte ID); ResetLatchButton(byte ID); ResetLatchCircle(byte ID); ResetLatchTriangle(byte ID); ResetAllTouchButton(); ResetAllTouchCircle(); ResetAllTouchTriangle(); ResetAllLatchButton(); ResetAllLatchCircle(); ResetAllLatchTriangle();
Sliders: VertSlider Like the buttons, this needs two sets of coordinates, top left and bottom right. These slider need ID numbers in order to have multiple sliders on the screen to work. A color is also need to indicate progression. Please note, the background color is set to black.
HorSlider -Same as VertSlider
BarGraphs: VertBarGraph as the counterpart of the sliders, these also need two sets of coordinates TL and BR. The bargraph needs a value and a set range as well as an ID and color. The value inputted will be mapped to the range and shown accordingly.
HorBarGraph -Same as VertBarGraph
ResetV_barGraph Like all the other reset functions, these all the bargraphs to be repainted on the screen when switching screens or using a menu system.
ResetH_barGraph -Same as above
Other Functions: Triangle Standard wireframe for making a triangle, takes three set of coordinates.
drawTriangle This will make the triangle in a circular plane, meaning it can be rotated to any given degree. It requires a X/Y coordinate, a base size, and the degree, default is 0.
fillTriangle Just like the drawTriangle function it requires the same input. I am trying to find a more efficient way to fill the triangle at any given degree.
Polygon This will create a closed polygon based on the sides entered (max 360). It needs an X/Y coordinate, the number of sides you want to make, a diameter of how big you want it to be, a RGB color, Filled or Not Filled, and a degree(optional).
fillPoly Contrary to its name, it fills in a triangle based on the three sets of coordinates provided.
drawStar Creates a perfect star. Takes a X/Y coordinate, diameter, RGB color, Filled/Not filled, and a factor(optional, default is 2.0). The factor determine the thickness of the triangular points
drawArc Takes an X/Y coordinate, a radius, thickness, a start and stop point, a RGB color and boolean T/F(default is False) to determine if you want to close the oval like a pie slice.
drawOvalArc Like drawArc, but this requires two radius values and two thicknesses.
SetupStandard_KB needed to setup the keyboard's font and orientation, but only requires user to enter the font type. Bigfont not supported.
SetupMobile_KB needed to setup the keyboard's font and orientation, Bigfont is the default font type.
Standard_KeyBoard Creates a keyboard on screen that mimics a standard computer keyboard but without the F buttons(F1 - F12) and window/option button.
Moblie_KeyBoard Creates a keyboard on screen that mimics the IPhone/Android keyboards.
ReceiveMsg Need to receive incoming message.
Special functions: drawMoon Needs a X/Y coordinate, a radius and a phase WANING_GIBBOUS 7, THIRD_QUARTER 6, WANING_CRESCENT 5, NEW 4, WAXING_CRESCENT 3, FIRST_QUARTER 2, WAXING_GIBBOUS 1, FULL 0. Can be entered by name or value.
rounded_Square Takes a X/Y coordinate, a height and width value, a radius, RGB color and Filled/Not filled. The radius determines how round the corners will be.
smiley_Face Create the standard yellow smiley face. Takes a X/Y coordinate, a radius, and a value for the eyes and mouth. (Eyes max is 9, mouth max is 7) Presets are can be found in the .h file
HourGlass SpeechBubble drawGauge ResetGauge