[Solved] How to get Display Index

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.
Post Reply
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

[Solved] How to get Display Index

Post by GVovkiv »

So, i need to get display index as argument for function
For example:

Code: Select all

love.graphics.print(*displayindex*, 0, 0)
I know there exist love.window.getMode() function, but i don't know how to get "display" from that table directly
Thanks
Last edited by GVovkiv on Sat Jan 23, 2021 1:29 pm, edited 1 time in total.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to get Display Index

Post by pgimeno »

It's basic table indexing.

Code: Select all

love.graphics.print(select(3, love.window.getMode()).display)
The select() is there just for accessing the third element directly. This works too:

Code: Select all

local w, h, flags = love.window.getMode()
love.graphics.print(flags.display)
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How to get Display Index

Post by GVovkiv »

pgimeno wrote: Mon Jan 18, 2021 8:52 pm It's basic table indexing.

Code: Select all

love.graphics.print(select(3, love.window.getMode()).display)
The select() is there just for accessing the third element directly. This works too:

Code: Select all

local w, h, flags = love.window.getMode()
love.graphics.print(flags.display)
Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests