Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
itsatomf
Prole
Posts: 5 Joined: Wed Aug 24, 2022 7:37 am
Post
by itsatomf » Wed Aug 24, 2022 7:47 am
The title is confusing ikr
So, how do I run both love2d functions and lua builtin functions, like when I'd like to debug, smth like:
Code: Select all
text = "e"
print(e)
function love.draw()
love.graphics.print(text)
end
By doing so, I could run both love2d functions and the functions from lua itself.
So, how could I?
Andlac028
Party member
Posts: 174 Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia
Post
by Andlac028 » Wed Aug 24, 2022 10:34 am
I don't know, if I understand correctly, but in love2d, you can use both build-in lua and love2d functions. For example:
Code: Select all
text = "e"
function love.draw()
print(text)
love.graphics.print(text)
end
EDIT: fixed bad variable name in print()
Last edited by
Andlac028 on Thu Aug 25, 2022 4:39 am, edited 1 time in total.
GVovkiv
Party member
Posts: 685 Joined: Fri Jan 15, 2021 7:29 am
Post
by GVovkiv » Wed Aug 24, 2022 10:59 am
love is just lua (luajit to be specific) interprier with bundled ontop sdl2, audio coding/decoding, and more functionality, so i'm not sure what you mean.
BrotSagtMist
Party member
Posts: 657 Joined: Fri Aug 06, 2021 10:30 pm
Post
by BrotSagtMist » Wed Aug 24, 2022 11:03 am
Maybe he wants print() to return on the game screen AND the terminal?
Code: Select all
op=love.graphics.print
love.graphics.print=function(...)
print(...)
op(...)
end
obey
pgimeno
Party member
Posts: 3656 Joined: Sun Oct 18, 2015 2:58 pm
Post
by pgimeno » Wed Aug 24, 2022 11:09 am
Or maybe he needs to use lovec.exe instead of love.exe to see the output of print().
GVovkiv
Party member
Posts: 685 Joined: Fri Jan 15, 2021 7:29 am
Post
by GVovkiv » Wed Aug 24, 2022 12:48 pm
or use some sort of ide with built-in terminal, who knows.
itsatomf
Prole
Posts: 5 Joined: Wed Aug 24, 2022 7:37 am
Post
by itsatomf » Thu Aug 25, 2022 1:37 am
Andlac028 wrote: ↑ Wed Aug 24, 2022 10:34 am
I don't know, if I understand correctly, but in love2d, you can use both build-in lua and love2d functions. For example:
Code: Select all
text = "e"
function love.draw()
print(e)
love.graphics.print(text)
end
that didn't worked for me
itsatomf
Prole
Posts: 5 Joined: Wed Aug 24, 2022 7:37 am
Post
by itsatomf » Thu Aug 25, 2022 1:40 am
pgimeno wrote: ↑ Wed Aug 24, 2022 11:09 am
Or maybe he needs to use lovec.exe instead of love.exe to see the output of print().
huh?
itsatomf
Prole
Posts: 5 Joined: Wed Aug 24, 2022 7:37 am
Post
by itsatomf » Thu Aug 25, 2022 1:42 am
GVovkiv wrote: ↑ Wed Aug 24, 2022 10:59 am
love is just lua (luajit to be specific) interprier with bundled ontop sdl2, audio coding/decoding, and more functionality, so i'm not sure what you mean.
I mean like, I can't run both lua and love2d function, like I can love.graphics.print("e") to the screen, but I can't print("e") (<- is a builtin function btw not love.graphics.print(), just print()) to the terminal.
BrotSagtMist
Party member
Posts: 657 Joined: Fri Aug 06, 2021 10:30 pm
Post
by BrotSagtMist » Thu Aug 25, 2022 2:11 am
You where trying it without quotation marks the whole time i must assume.
print('e') will absolutely work. print(e) will not...
obey
Users browsing this forum: Bing [Bot] and 3 guests