slider fix 1 (add nextion2text)

This commit is contained in:
joBr99
2023-04-17 17:53:32 +00:00
committed by github-actions[bot]
parent 85e898e70c
commit 1890f2e38e
6 changed files with 111 additions and 51 deletions

View File

@@ -71,7 +71,7 @@ Page popupLight
}
Postinitialize Event
xstr hBrightness.x,hBrightness.y,100,250,7,BLACK,6371,0,0,1,"a"
//xstr hBrightness.x,hBrightness.y,100,250,7,BLACK,6371,0,0,1,"a"
Variable (int32) col
Attributes
@@ -185,11 +185,12 @@ Slider hBrightness
Events
Touch Release Event
//draw black background
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,BLACK,6371,0,0,1,"a"
//xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,GREEN,6371,0,0,1,"a"
xstr hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,7,8484,6371,0,0,1,"a"
//draw draw colored bar at the position of the current brightness value
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,7,col.val,BLACK,2,4,1,"a"
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,7,col.val,8484,2,4,1,"a"
//paint an inverse of the character over everything, this rounds the corner at the bottom
xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,6371,0,0,0,3,"b"
xstr hBrightness.x,hBrightness.y+1,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
if(hBrightness.val>7)
{
//draw cursor
@@ -197,7 +198,7 @@ Slider hBrightness
}
//draw black strip to the right of the slider
//force a redraw of the slider, to ensure it is on top
vis hBrightness,1
//vis hBrightness,1
tmCooldown.en=1
tmCooldown.tim=2500
//craft command
@@ -416,7 +417,6 @@ Timer tmSerial
spstr strCommand.txt,tTmp.txt,"~",3
covx tTmp.txt,sys0,0,0
col.val=sys0
click hBrightness,0
//tEntity.pco=sys0
// get Button State
spstr strCommand.txt,tTmp.txt,"~",4
@@ -438,6 +438,18 @@ Timer tmSerial
if(tmCooldown.en==0)
{
hBrightness.val=sys0
//draw black background
//xstr hBrightness.x,hBrightness.y,100,hBrightness.h,7,GREEN,6371,0,0,1,"a"
xstr hBrightness.x,hBrightness.y,100,hBrightness.val*-25/10+250,7,8484,6371,0,0,1,"a"
//draw draw colored bar at the position of the current brightness value
xstr hBrightness.x,hBrightness.val*-25/10+314,100,hBrightness.val*25/10,7,col.val,8484,2,4,1,"a"
//paint an inverse of the character over everything, this rounds the corner at the bottom
xstr hBrightness.x,hBrightness.y+1,100,hBrightness.h,7,defaultBcoColor,0,0,0,3,"b"
if(hBrightness.val>7)
{
//draw cursor
fill hBrightness.x+25,hBrightness.val*-25/10+322,50,4,WHITE
}
}
}
// get ColorTemp value