Skip to content
lordloki edited this page Oct 10, 2018 · 2 revisions
    #x = (int(render.getWindowWidth()/2)/render.getWindowWidth())-logic.mouse.position[0]
    #y = (int(render.getWindowHeight()/2)/render.getWindowHeight())-logic.mouse.position[1]
    
    w, h = render.getWindowWidth() - 1, render.getWindowHeight() - 1
    center_x = w // 2 / w # truediv operation
    center_y = h // 2 / h # truediv operation
    x = center_x - logic.mouse.position[0]
    y = center_y - logic.mouse.position[1]
Clone this wiki locally