[Laszlo-dev] getMouse kernel API call

Henry Minsky henry.minsky at gmail.com
Wed Apr 2 15:41:15 PDT 2008


LzView.getMouse() calls the kernel sprite getMouse() method with an
arg, but the sprite methods in swf and dhtml kernel are
defined to ignore the arg, and always return an object of the form {x:
num, y: num}

function getMouse( xory ) {
    if (this.__movecounter != LzGlobalMouse.__movecounter) {
        this.__movecounter = LzGlobalMouse.__movecounter;
        this.__mousecache = this.sprite.getMouse(xory);
    }
    if (xory == null) return this.__mousecache;
    return this.__mousecache[xory];
}

This seems kind of inefficient, plus we have this movecounter thing
and the caching, couldn't we just
implement the sprite API to use the "xory" arg and return a number
instead of an object?



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com


More information about the Laszlo-dev mailing list