• Адміністратор
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

Get text/size/anything from the weather element

Topics related to the creation, development, and designing of the watch faces.

Модератори: asoo, Watchmens

Правила форуму
When adding a new topic, use the template: Topic title [device name]
For example: How to create watch face [Bip U]
All communication in this branch should only be in English.
Відповісти
Аватар користувача
frankh93
Повідомлень: 37
З нами з: 20 червня 2025, 00:32
Звідки: CDMX
Has thanked: 21 time
Been thanked: 3 times
Контактна інформація:

Get text/size/anything from the weather element

Повідомлення frankh93 »

I'm making an edit of my watchface "Dotted Clock" and it's gonna have different colors for the whole wathface (little spoiler haha), but having a problem to show the hrm and weather temp correctly.

Зображення

I've had made cuts in the bg to fit the imgs numbers showing the data for hrm and temp (the numbers individually are 35x47) so for the hrm the cut is 105x47 (so it fits when hrm is over 100) and for the weather temp is 140x47 (considering minus sign, 2 digits for numbers and the degree sign). The exact problem is that when the number width is less than the cut out the color can get through the empty space next to the number and I wanna find a workaround to fix this.

Already have the images to "cover" the empty spaces depending on the number of digits the hrm and weather temp are using but haven't find a way to get the width size of the current element of the text. I've managed to use getProperty(hmUI.prop.W) for the weathertemp but I get the size of the whole possible thing and not whats showed in the moment. All this might sound like a mess but hopefully someone can understand and help me. Also thank you before hand if you made it reading until this point :D
you should be doing something productive instead of reading this caption :lol:
Аватар користувача
asoo
Повідомлень: 2128
З нами з: 03 січня 2019, 01:48
Звідки: ͼͽ Thailand ͼͽ
Has thanked: 411 times
Been thanked: 2046 times

Повідомлення asoo »

If I understand your explanation correctly, you want to create a color-changing dial. You'll use the transparent image property to create a dial that changes all the text colors. However, you're having trouble with the uneven image sizes, which can lead to uncovered spaces.

In this section, I used the method of changing the image file of that element to get the desired color.
Therefore, you don't have to worry about the uneven size and gaps in the background color coverage.

I've included an example of my design. I hope it's helpful.

To change the color, click on the top of the screen.
When you click on the color, the screen will turn off. Click on the screen again to turn it back on and refresh the color changes.

Sample :
Зображення
Dotted-Clock-EN.zip
(994.07 Кіб) Завантажено 69 разів
ͼͽ To request please use the interrelated forum in action ͼͽ
Please do not PM to me for requests ported watchface.
Аватар користувача
SashaCX75
Повідомлень: 820
З нами з: 26 жовтня 2019, 15:18
Звідки: Ukraine
Has thanked: 13 times
Been thanked: 1029 times
Контактна інформація:

Повідомлення SashaCX75 »

Use the sensor to obtain the value of the displayed parameter (e.g., heart rate). Knowing the value, you can find out how many digits it has and calculate its size.
Аватар користувача
frankh93
Повідомлень: 37
З нами з: 20 червня 2025, 00:32
Звідки: CDMX
Has thanked: 21 time
Been thanked: 3 times
Контактна інформація:

Повідомлення frankh93 »

@asoo tysm for the help, managed to do it that way and now it's posted

@SashaCX75 tried that way, but as im pretty noob with js gave up and wanted an easier way (especially when i had to edit the images needed for all the colors i added)... could you give details about how to do it tho? i looked into zepp docs and i saw i could catch the data using listeners, but didnt understand it that well (especially for the weather)
you should be doing something productive instead of reading this caption :lol:
Відповісти

Повернутись до “Watchfaces discussion”

Хто зараз онлайн

Зараз переглядають цей форум: Немає зареєстрованих користувачів і 1 гість