def pixel_from_screen(self, x, y):
        # director display scaling
        if director.autoscale:
            x, y = director.get_virtual_coordinates(x, y)

        # normalise x,y coord
        ww, wh = director.get_window_size()
        sx = x / self.view_w
        sy = y / self.view_h

        # get the map-space dimensions
        vx, vy = self.childs_ox, self.childs_oy

        # get our scaled view size
        w = int(self.view_w / self.scale)
        h = int(self.view_h / self.scale)

        # print (int(x), int(y)), (vx, vy, w, h), int(vx + sx * w), int(vy + sy * h)

        # convert screen pixel to map pixel
        return int(vx + sx * w), int(vy + sy * h)
Look up the Layer-space pixel matching the screen-space pixel.
dataset/ETHPy150Open los-cocos/cocos/cocos/layer/scrolling.py/ScrollingManager.pixel_from_screen