Quote:
Originally Posted by Drumstix42
I'm having trouble resetting an Effector after it's finished.
The element:
Code:
<Image Location="-40,0" Name="Progress" OnEffectFinished="Parent.Reset.press=true" OnShowEffector="FillIn" Size="40,4" >
effector:
Code:
<LocationEffector Name="FillIn" setoneffect="true" Speed="20,0" TargetLocation="0,0" />
The Reset:
Code:
<Button Name="Reset" OnPress="Parent.Bar.Visible=false
Parent.Bar.Visible=true" Style="/ButtonStyles.invisible" Visible="false" />
The effector works once, but then the element stays Visible.
No matter what I do I can't seem to get the bar to Reset to default location, hide, and replay the animation. Am I missing something? Too little sleep?
If I try to directly hide the element after the effector finishes, the game seems to crash. So does the UIBuilder. I can cause another element show, even a copy of the same one, but trying to hide the initial element via script = crash.
|
See if this sample helps any. Directly hiding the effected element also crashes me, so I just wrap it inside another page. This one picks up the element and forces it back to starting position each time until you hit the stop button.
Code:
<Page Name="EventPanel" Location="40,40" ScrollExtent="44,44" Size="44,44" OnHide="Bar.Visible=Visible
Bar.Left=0" OnShow="Bar.Visible=Visible" PackLocation=",fff" BackgroundColor="#504050" BackgroundOpacity="0.500" Visible="false">
<LocationEffector Name="FillIn" Speed="20,0" TargetLocation="44,0" />
<Page Name="Bar" Location="0,0" OnMove="Parent.Reset.Visible=(Left > 41)" OnShowEffector="FillIn" ScrollExtent="44,44" Size="44,44" BackgroundColor="#4488FF" BackgroundOpacity="0.600" Visible="false" />
<Page Name="Reset" OnShow="Parent.Bar.Left=0
Visible=false" Visible="false" />
</Page>
<Button Name="StartE" OnPress="Parent.EventPanel.Visible=true" Style="/CommonElements.SmallPushButton.data.style" Location="40,90" Size="40,20" />
<Button Name="StopE" OnPress="Parent.EventPanel.Visible=false" Style="/CommonElements.SmallPushButton.data.style" Location="40,110" Size="40,20" />
__