You are of course free to develop your own slide/place method.
However I would recommend the approach I suggested above.
However I would recommend the approach I suggested above.
Post by sourisdudesert »
Code: Select all
<div id=granada_king>
</div>
Code: Select all
#granada_king
{
position: absolute;
top: 450px;
left: 455px;
}
Code: Select all
this.placeOnObjectPos( 'kingIcon', 'grandada_king', 450, 455);
Code: Select all
this.placeOnObject( 'kingIcon', 'granada_king');
Code: Select all
height: 42px;
top: -824px;
left: 447px;
Code: Select all
height: 42px;
top: -664px;
left: 442px
Great thanks for the clarification and education!Een wrote: ↑26 November 2019, 19:19 This seems normal and expected
(placeOnObject() centers the mobile object in the destination while placeOnObjectPos() positions it at the given coordinates inside the destination; the computed coordinates are added to the initial coordinates, so if some initial coordinates are defined in the css it will offset the dynamic positioning)
Code: Select all
slideToObjectPos: function (t, i, n, o, a, s) {
if ('string' == typeof t) var r = $(t);
else r = t;
var l = this.disable3dIfNeeded(),
d = dojo.position(i),
c = dojo.position(t);
void 0 === a && (a = 500);
void 0 === s && (s = 0);
if (this.instantaneousMode) {
s = Math.min(1, s);
a = Math.min(1, a)
}
var h = dojo.style(t, 'left'),
u = dojo.style(t, 'top'),
p = {
x: d.x - c.x + toint(n),
y: d.y - c.y + toint(o)
},
m = this.getAbsRotationAngle(r.parentNode),
g = this.vector_rotate(p, m);
h += g.x;
u += g.y;
this.enable3dIfNeeded(l);
var f = dojo.fx.slideTo({
node: t,
top: u,
left: h,
delay: s,
duration: a,
easing: dojo.fx.easing.cubicInOut,
unit: 'px'
});
null !== l && (f = this.transformSlideAnimTo3d(f, r, a, s, g.x, g.y));
return f
},