pi0/clippyjs

Move command not working

Opened this issue · 1 comments

I try this

agent.moveTo(500,500);

The character does the move animation, but doesn't move anywhere.

I see that the html element has a width and height set of 128px for both values,
<div class="clippy" style="display: block; width: 128px; height: 128px; background: url(&quot;clippy/agents/Merlin/map.png&quot;) 0px 0px no-repeat; top: 229.5px; left: 224px;"><div style="display: none; width: 128px; height: 128px; background: url(&quot;clippy/agents/Merlin/map.png&quot;) 0px -1152px no-repeat;"><div style="display: none; width: 128px; height: 128px; background: url(&quot;clippy/agents/Merlin/map.png&quot;) no-repeat;"></div></div></div>

I can modify that in clippy.min.js, or even within chrome dev tools.

But when I drag width or height larger than 128px, the agent starts to repeat itself, and show itself duplicated every few hundred pixels.

image

How do I fix this, so I can get the agent to move like it should when I execute the moveTo function?

When I make the clippy element have a position of relative, I can then use jquery to do this

$(".clippy").delay(2500).animate({ left: a+"px", top: b+"px" }, 3500);

This is within the moveTo()

Any better integrations?