TftBatteryIcon()

Library Description ›› Shapes ›› Shapes ››
… visits
Parent Previous Next

Syntax

TftBatteryIcon(wX_1 As Word, wY_1 As Word, wX_3 As Word, wY_3 As Word, bPercent As Byte, wOutlineColor As Word, wFillColor As Word, pClearInside As Bit, wBackColor As Word)

Parameters

Overview

wX_1,wY_1,wX_3,wY_3 — bounding box of the battery body (not including the terminal nub)

Parameter

Description

bPercent

charge level, 0-100

wOutlineColor

outline/terminal color

wFillColor

charge-level fill color

pClearInside

1 - clear the inside with wBackColor before filling, 0 - skip

wBackColor

clear color, only used if pClearInside = 1

Draws a battery icon

Note: use TftBatterySet() to set new battery level.

Example

TftSetUp(0, 0)

TftResetScreen(BLACK)

TftBatteryIcon(90,100,220,130,10,BRONZE,BLUE,1,0x9D19)

DelayMS 1000

TftBatterySet(30)

DelayMS 1000

TftBatterySet(70)

DelayMS 1000

TftBatterySet(50)

DelayMS 1000

TftBatterySet(20)

Created with the Personal Edition of HelpNDoc: Free help authoring tool