htv04 / wiilove

Framework for making 2D Nintendo Wii homebrew games in Lua
GNU Lesser General Public License v3.0
66 stars 8 forks source link

Text draws above coordinates #6

Closed TetrisKid48 closed 2 years ago

TetrisKid48 commented 2 years ago

I can't get text to print. I made a quick test program to print the button pressed on screen whenever the cursor is and it doesn't seem to work, however the pointer I added is working fine so the wiimote is being detected for sure. I also tried printing text just to (0, 0) and within love.draw and that didn't work either.

Here is my code:

local wiimote, pointer
local textFont

function love.load()
    wiimote = love.wiimote.getWiimotes()[1]
    pointer = love.graphics.newTexture("assets/pointer.png")

    textFont = love.graphics.newFont(20)
    love.graphics.setFont(textFont)
    love.graphics.setColor(255, 255, 255)
end

function printKey(letter)
    love.graphics.print(letter, wiimote:getX(), wiimote:getY())
end

function love.update(dt)
    if wiimote:isDown("b") then
        printKey("b")
    end
end

function love.draw()
    love.graphics.print("Welcome to SuperGame", 0, 0)
    love.graphics.draw(pointer, wiimote:getX(), wiimote:getY(), wiimote:getAngle(), 1, 1, 48, 48)
end

I am trying to figure out wiilove's features through reading the Wiirdle code btw. Thanks.

TetrisKid48 commented 2 years ago

Very sorry, just read one of the closed issues and now i see why printing at 0, 0 would not work, but the other line of code is still broken. I tried added code to round the positions but that didn't help.

htv04 commented 2 years ago

Already fixed as of 0da46dac040faf2f502359fdc30f6a71c9f918d9

TetrisKid48 commented 2 years ago

Not sure what you mean? How do I download the version with the bug fix? The most recent release is from before then.

htv04 commented 2 years ago

You would need to compile it, but the issue has been fixed in the latest commit. It will be included in the next release (which will have a compiled build).