Can someone please tell me how to make a moon image fade in when it gets dark and fade back out in the morning?
Try use #DISDAYTIME#.
$#DISDAYTIME#==true?20:100$
Would either of you know how to convert this to watchmaker format? it does not recognise #DISDAYTIME# command
also what do â$â â?â mean?
Sorry I do not know what âwatchmakerâ format is.
The symbols are used in condititional expressions, see: Conditionals | Facer Documentation
Watchmaker uses Lua
Sorry, I canât help with anything to do with watchmaker - Iâve never used it and I donât know how to convert watchmaker like commands/expressions into Facer ones.
The tutorials and guides in the Facer documentation should help you understand how Facer works. Knowing this will make understanding the more advanced features, like time based fading, much easier.
Sorry, not trying to fob you off, I am happy to help, but it will be m\uch easier to help you if you understand the basics first.
Ill look into doing my project with facer then. Perhaps you could help with this:
How would you go about making an image of a moon appear at night and fade in/out a few hours before and after sunrise/set?
Would you be able to explain some of the variables used.
You could do this using the expression in the link I posted above
The expression that @tara.goisisi came up with is below:
$(#DH#+1)<(#WSH#)&&(#DH#+1)>(#WRH#)?0:$$(#DH#+1)>=(#WSH#)&&(#DH#+1)<=(#WSH#)?((#Dm#)(100/60)):$$(#DH#+1)<=(#WRH#)&&(#DH#+1)>=(#WRH#)?(100-(#Dm#(100/60))):100$
This would be posted into the Transparency field ( in the advanced pop up window ) for your moon layer.
The expression above is a complicated set of nested conditional statements of the form:
If A then W
elseif B then X
elseif C then Y
else Z
or in Facer syntax:
$ A ? W : $$ B ? X : $$ C ? Y : Z $
Because this expression is in the transparency field it evaluates to Transparency being equal to one of W,X,Y or Z
Anything enclosed in # symbols is a tag. You can think of tags as built-in functions that return a text or numeric value. The list of available tags and their descriptions can be found here: Tags | Facer Documentation
&& is a Boolean Operator : Boolean Logic | Facer Documentation
, >=, etc. are operators: Expressions | Facer Documentation
So, in the above, A = (#DH#+1)<(#WSH#)&&(#DH#+1)>(#WRH#)
This reads as
A = ( hour_in_day +1 ) less_than sunset_hour and ( hour_in_day +1 ) greater_than sunrise_hour
which will evaluate to true or false
Since W = 0, the first part of the conditional reads as, if A then set Transparency to zero, if not then keep evaluating the expressionâŚ
( note that in Facer, Transparency = 0 means hidden and Transparency = 100 means fully visible )
I hope that helps.
âŚ
Edit: This topic has already been extensively discussed in this tutorial ( and in a much clearer way ):
Tremendously thank you! So far I have just been browsing thru watches seeing which faces can be customised so I can take a gander at the scripts and try to learn what each does and how. I have some good ideas just need to learn how to realise them in code so I really appreciate the quick facer 101.
You are most welcome.
How would I go about displaying âIn prog.â or âCompleteâ where it would change visibility when my #ZSC# < #set goal# and then when #ZSC# >= #set goal# it would switch.
I ran this script that defines the goal
var_steps=5000
function setstep()
if var_steps==10000
then
var_steps=5000
else
var_steps=var_steps+2500
end
end
That works fine and I made a tapable layer to switch between the three different goals. How do I calculate and display using my defined variable?
So basically if A=steps and B = goal how would I make this formula in facer:
If A < B then 0 else if A >= B then 100
And use that in the opacity setting for the two different texts and switch the â0â and â100â to alter which is shown. I canât seem to figure out where I need () vs. ââ vs. [] to get it to calculate. Also how would I use this info to display A/B as a percent. Any advice is helpful. I can get it to show âA/Bâ but not the value (A/B) when trying to convert it to a percent or display a â%â sign I get an error.
I am sorry, using scripts in Facer is way outside my knowledge. As far as I know it is not possible to have a user defined variable or to run scripts. If you have got it even partly working then you are way ahead of me
The way I would do something similar to what you are asking is âŚ
-
Decide on a âhard codedâ constant for the goal number of steps; letâs say 10,000
-
Create two layers or sets of layers, one layer/set for in_progress and one layer/set for Complete
-
For the layer(s) used for in_progress, set transparency to: $#ZSC#<10000?100:0$
-
For the layer(s) used for Complete, set transparency to: $#ZSC#<10000?0:100$
I hope that helps.
Is there a way to create a tag? I have seen watches that have a step goal that switches between 5, 10, and 15k steps and it has a shaded meter bar as well as a % display.
Where do you define what tapping an item does then if there is no script.? Most of my faces that have tap functions are based on them using tags that facer doesnât know.
You could have a look here: Facer Creator Pro â How can we help?
There are some built in variables that you can increment and decrement when the user taps an area of the screen. The âProâ features require a subscription to access.
Looks like a lot of what Iâd like to do requires âPROâ can you maybe help me with this one:
Iâm trying to get an image to âbeatâ when the watchface is bright and remain visible when dim.
$#ZLP#==false?100:3*(floor(200*(sin(.99*(pi)(*#Ds#))$
I canât seem to figure out where the brackets () need to go to make it work. Iâm adapting from the following formula from Lua for the same effect.
{abright}==false and 100 or 3math.floor(200math.sin(.99*math.pi{ds}))
Mmm, I have not used #ZLP# and I donât know what values it can take. The documentation uses an example value of ânullâ and I donât know how to test for that. Maybe it is a simple as saying #ZLP#==null, I donât know.
as for the brackets.
you donât need ones around pi or tags and I would generally place operators between brackets rather than have a closed bracket immediately followed by an open bracket. So, assuming that the expression is otherwise ok, I would write your expression as
$#ZLP#==false?100:3*(floor(200sin(0.99pi*#Ds#)))$
{ by the way donât you mean "âŚ?0:3*(floor⌠"? That is, 0 not 100 because transparency 100 means fully visible and not invisible. Counter intuitive I know }
âŚ
Now having said all that, I would try to achieve what you want in a different way using two layers not one.
For the first one I would use your beat formula "3*(floor(200sin(0.99pi*#Ds#)))"in the transparency field for the layer, make sure visibility is âturned onâ for the âbright layerâ but turn of visibility in the dim mode by clicking on the eye symbol under the layerâs name on the âbrightâ and âdimâ panels.
And for the second layer I would set the transparency to a fixed value of 100% and do the opposite with the visibility in the âbrightâ/âdimâ panels.
Does that make sense?
Actually the way you laid it out facer understands AND it accomplished the effect I was hoping for so THANK YOU! You were correct. {abright}==false means âNot brightâ so for #ZLP# I needed it to be âNot low powerâ in order for it to work correctly so:
$#ZLP#==true?100:3*(floor(200sin(0.99pi*#Ds#)))$
Yeah. Iâm finding Facer is much less efficient in some aspects and a little more practical in others. wish I knew how to take advantage of both⌠To make a custom battery meter I had to do 20 images and specify the opacity on each instead of being able to run a simple script or adjusting the default meter. Iâm having to create LOTs of clone layers to accomplish my effects. My first draft is about done. please check it out and give some feedback.
Iâm also having trouble figuring out what the values of #BS# are because I get 1 or 0 and I dunno how to use that for a charging status indicator. Iâm used to a true/false or a âchargingâ ânot chargingâ to base my expression off. thanks again for the help.
I like how the face is coming along. The dim mode in particular is very attractive and the steps animation is very cute.
I have not use #BS#.
If its possible values are 1 or 0 then perhaps you could simply test to see if it equals 0 or 1 and set the transparency of you layer depending on the result.
ie.
$#BS#==0? etc.