Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sprite image only refreshing when display turns off and on

Hi Community,

 

I'm struggling a bit with the sprite image component. Here is what I did:

 

index.gui

<symbol id="frames" href="#sprite-image">
<animate id="anim" attributeName="value" begin="enable"
from="0" to="5" dur="3"
repeatDur="3" repeatCount="indefinite" />
<image id="imageExercise" href=""/>
</symbol>

...

<svg class="exercise" display="none">
<use id="animateExercise" href="#frames"/>
</svg>

 

work.js (simplified)

/** Show animation */
showAnimation () {
utils.show(this.exerciseView);
this.imageExercise.href = this.animationList[this.currentIndex].image;
// Configure animation settings depending on number of images for this exercise
this.exerciseAnimation.to = this.animationList[this.currentIndex].imageMax;
this.animationExercise.animate("enable");
}
/** Hide animation */
hideAnimation () {
utils.hide(this.exerciseView);
this.animationExercise.animate("disable");
}

 

Then, depending on the app state, I either call showAnimation or hideAnimation.

Unfortunately, this code only works with the simulator. On my watch, I can only see the first image being displayed properly and animation never starts. I noticed that if my display turns off and if I turn it on again by pressing the physical left button, I can see the next image being displayed. It's like the animation is "pausing".

Any help would be appreciated.

Best Answer
0 Votes
1 REPLY 1

If it's working on the simulator, then the code is probably correct. Are your image files the correct resolution for the device? Don't make the device resize them, it doesn't have the memory or processing power.

Best Answer
0 Votes