Effect flickers

hello,

i try to have a panel that shows up on mouse hover and hide once the mouse got away
i keep a bit of the panel appearing on the left of the screen so one can access it

so far i use this code

[java]
effect
onStartHover name=“move” mode=“toOffset” direction=“left” length=“100” startDelay=“0” inherit=“true” offsetX=“300” offsetY=“0” onEndEffect=“panelShow()”/
onEndHover name=“move” mode=“toOffset” direction=“left” length=“100” startDelay=“0” inherit=“true” offsetX="-300" offsetY=“0” onEndEffect=“panelHide()”/
/effect
[/java]

and i use callbacks to keep the panel in place

[java]
public void panelHide()
{
Element panel=screen.findElementByName(“panel”);
panel.setConstraintX(new SizeValue("-300px"));
panel.getParent().layoutElements();
}

public void PanelShow()
{
    Element panel=screen.findElementByName("panel");
    panel.setConstraintX(new SizeValue("0px"));
    panel.getParent().layoutElements();
}

[/java]

so it works
but as the effect ends up,
1 - the panel goes back in original position instead of staying at offset
2 - then it goes where it is supposed to be via the callbacks results

so it flickers before appearing at offset

i dont know how to manage this

if i use neverStopRendering=“true”, the panel will stay in place, but forever, discarding the onEndHover situation

so it will never hide once i move the mouse away

is there any way to remove the neverStopRendering=“true” after the panel is set into place ?

i can’t think of anything else so far

thx

anyone?

i mean it is really anoyng situation and nifty should be able to deal with these simple stuffs

Sorry, this isn’t something I’ve ever tried to do.

You could maybe do something using the onHover effect rather than onStartHover and onEndHover?

If all else fails you could do the sliding out yourself by just moving it every frame until it’s at the desired position.

<cite>@zarch said:</cite> Sorry, this isn't something I've ever tried to do.

You could maybe do something using the onHover effect rather than onStartHover and onEndHover?

i tried, but anyway the effect has to be put on start and end

<cite>@zarch said:</cite> If all else fails you could do the sliding out yourself by just moving it every frame until it's at the desired position.

i was thinking about having neverStopRendering=“true”
and in the callbacks, remove or disable the effects or put neverStopRendering=“false”

but how do i do that ? programaticaly

You can cancel the effect by calling stopEffect on the element. screen.findElementByName(“blah”).stopEffect(Effect.OnMouseOver) or something like that.

<cite>@zarch said:</cite> You can cancel the effect by calling stopEffect on the element. screen.findElementByName("blah").stopEffect(Effect.OnMouseOver) or something like that.

thx mate