Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: transformPoint and inverseTransformPoint not working #238

Open
1 task done
STBrian opened this issue Sep 16, 2024 · 0 comments
Open
1 task done

[Bug]: transformPoint and inverseTransformPoint not working #238

STBrian opened this issue Sep 16, 2024 · 0 comments
Labels

Comments

@STBrian
Copy link

STBrian commented Sep 16, 2024

Software Version

3.0.1

What Happened?

love.graphics.inverseTransformPoint and love.graphics.transformPoint do not work as expected. After performing the transformations using (in my case) love.graphics.translate, using the previous 2 functions results in both returning (0, 0) in any case.

What was Expected?

Functions should return coordinates with current transformations applied

Code to Reproduce

-- This should draw a rectangle at screen position 100, 100 even after setting a coordinates translation

function love.load(args)
    cameraX = 0
    cameraVel = 100
end

function love.update(dt)
    cameraX = cameraX - (cameraVel * dt)
end

function love.gamepadpressed(joystick, button)
    if button == "start" then
        love.event.quit()
    end
end

function love.draw(screen)
    love.graphics.push()
    love.graphics.origin()
    love.graphics.translate(cameraX, 0)
    if screen ~= "bottom" then
        local x, y
        x, y = love.graphics.inverseTransformPoint(100, 100)
        love.graphics.rectangle("fill", x, y, 100, 50)
    end
    love.graphics.pop()
end

Console

Nintendo 3DS

Firmware Version(s)

11.17.0-50U

Custom Firmware Version

13.1.2

Execution Method

Homebrew Menu

Code of Conduct

  • I have read the Code of Conduct and agree to these terms
@STBrian STBrian added the bug label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant