Or rather, that's what the "crop image" value for the "sta" attribute in the text object is for--making the object background an image cropped from the image you select.Ah, so that's what that "crop image" object is for
But you can do that with program code, either on the Nextion or with a controlling picaxe.if you change color of the background you would have to go to each "transparent" component and change the background color there as well.
It renumbers the object IDs, but doesn't change the component name, so if you refer to the objects by name instead of object number, you will be OK.... if you delete a component the display will renumber all the rest of the components so they are all again in sequence.
What I said above is apparently not true. I found this in a Feature Request thread: "an HMI object can not be moved across the screen, its x, y, w, and h are permanent once defined in the HMI and no attempt at changing this during runtime will succeed. Hard coded"... the x and y positions of the button could be changed by the picaxe or MCU (or by code running on the Nextion)
dirsC=%00000010
symbol nxout=C.1
symbol nxin=C.0
symbol nxbaud=T9600_8
symbol vT=b3
symbol vH=b4
symbol hour =b5
symbol mins=b6
symbol heaton=b7
symbol fan=b8
symbol dehumon=b9
symbol humon=b10
symbol date=b11
symbol month=w10
symbol day=b13
symbol year=w23
symbol AM=b15
symbol td=b16
symbol sd=b17
symbol vtd=b18
debug
main:
Vt=28:vH=73:hour=23:mins=55:date=23:year=2017:vtd=25
do
Serout nxout, nxbaud, (" page main")
Gosub ff
Serout nxout, nxbaud, ("temp.val=",#vTd)
gosub ff
Serout nxout, nxbaud, ("setc.val=",#vT)
gosub ff
Serout nxout, nxbaud, ("rh.val=",#vH)
gosub ff
Serout nxout, nxbaud, ("dt.val=",#date)
gosub ff
Serout nxout, nxbaud, ("yr.val=",#year)
gosub ff
Serout nxout, nxbaud, ("setrh.val=",#vH)
gosub ff
Serout nxout, nxbaud, ("hr.val=",#hour)
gosub ff
Serout nxout, nxbaud, ("mn.val=",#mins)
gosub ff
Serout nxout, nxbaud, ("ht.txt=",34,"OFF",34)
gosub ff
Serout nxout, nxbaud, ("cf.txt=",34,"ON",34)
gosub ff
Serout nxout, nxbaud, ("dhm.txt=",34,"OFF",34)
gosub ff
Serout nxout, nxbaud, ("hm.txt=",34,"OFF",34)
gosub ff
Serout nxout, nxbaud, ("usb.txt=",34,"ON",34)
gosub ff
Serout nxout, nxbaud, ("mode.txt=",34,"Manual",34)
gosub ff
Serout nxout, nxbaud, ("dy.txt=",34,"Sunday",34)
gosub ff
Serout nxout, nxbaud, ("mth.txt=",34,"September",34)
gosub ff
Serout nxout, nxbaud, ("am.txt=",34,"AM",34)
gosub ff
Serout nxout, nxbaud, ("st.txt=",34,"rd",34)
gosub ff
inc vtd
if vtd=101 then
vtd=1
endif
pause 5000
Serout nxout, nxbaud, ("am.txt=",34,"PM",34)
gosub ff
debug
loop
ff: Serout nxout, nxbaud, ($FF,$FF,$FF)
Return
#picaxe 14m2
symbol pNextionIn = C.1
symbol pNextionOut = C.2
symbol nextion_baud_rate = T9600_16
Setfreq M16
main:
do
b1 = $ff ' invalid
hserin b1 ' if no bytes ready, no change
if b1 = "!" or b1 = "#" then ' valid command
pause 50 ' allow 2nd character to arrive, if need be
hserin b2
endif
select b1
case "#" ' page change -- add a "select b2"
case "!" ' command
select b2
case "0" ' respond somehow
case "1" ' respond somehow
case "^" ' nextion requesting to send 6 characters
Serout pNextionOut, nextion_baud_rate, ("print v1.txt",$FF,$FF,$FF)
serin pNextionIn, nextion_baud_rate,b22,b23,b24,b25,b26,b27
sertxd(b22,b23,b24,b25,b26,b27,cr,lf)
end select
end select
loop
Ouch! you touched a sensitive nerve.The product description on Amazon is a work of art;
". It is the best solution to replace the traditional LCD and LED Nixie tube.
"
.
#no_data
#no_table
main:
if b4 = $70 then
inc b3
if bit0 = 0 then
let bit0 = 1
serout c.4, t9600, ("light.txt=",$22,"Light On",$22,$FF,$FF,$FF)
else
let bit0 = 0
serout c.4, t9600, ("light.txt=",$22,"Light Off",$22,$FF,$FF,$FF)
end if
debug
end if
serin b.7, t9600,b4,b5,b6,b7,b8,b9,b10
goto main
serout c.4, t9600, ("light.txt=",$22,"Light On",$22,$FF,$FF,$FF)
serout c.4, t9600, ("light.txt=","Light On",$FF,$FF,$FF)
#Macro SetText( obj, txt )
SerOut C.4, T9600, ( obj,".txt=",$22,txt,$22, $FF,$FF,$FF )
#EndMacro
SetText( "light", "Light On" )
#no_data
#no_table
'setfreq m16
symbol dis_in = c.7
symbol dis_out = c.6
symbol baud = T9600
#terminal 9600
init:
pause 1000
hsersetup b9600_8, %00000001
hserout 0, ("page ","1",$FF,$FF,$FF)
'hserin 0, 4
hserptr = 0
setintflags %00100000,%00100000
main:
'serin c.7, t9600,b4,b5,b6,b7
'sertxd (#b4,44,#b5,44,#b6,44,#b7,13,10)
'need to look for page 10
if b4 = 102 and b5 = 10 then
high b.7
readadc 0, b8
hserout 0, ("sensor1.val=",#b8,$FF,$FF,$FF)
let w6 = b8 *10 *4 /100
let b8 = w6
hserout 0, ("bar1.val=",#b8,$FF,$FF,$FF)
readadc 1, b10
hserout 0, ("sensor2.val=",#b10,$FF,$FF,$FF)
let w6 = b10 *10 *4 /100
let b10 = w6
hserout 0, ("bar2.val=",#b10,$FF,$FF,$FF)
low b.7
end if
goto main
interrupt:
flags = 0
setintflags off
get 0, b4, b5, b6, b7
sertxd (#b4,44,#b5,44,#b6,44,#b7,13,10)
if b4 = 0X71 then
sertxd ("value:",44,#b5,13,10)
let b4 = 102
let b5 = 10
end if
hserptr = 0
setintflags %00100000,%00100000
return
if(slid.val==0)
{
slid.val=h0.val*8
n0.val=slid.val
}else
{
h0.val=slid.val/8
n0.val=slid.val
}