File | Date | Author | Commit |
---|---|---|---|
LICENSE.txt | 2024-04-20 |
![]() |
[ff3dee] License year renewed |
README.md | 2024-04-20 |
![]() |
[043106] Freely resizable window supported |
fullscreen.lua | 2024-04-20 |
![]() |
[043106] Freely resizable window supported |
main.lua | 2024-04-20 |
![]() |
[043106] Freely resizable window supported |
FSAL is "Full Screen Assistant for LÖVE".
FSAL provides a function to easily handle full screen mode when creating games with the LÖVE framework.
With FSAL you can easily implement full screen mode in your own games.
You will also be able to easily implement the ability to switch between full screen mode and window mode.
Initialize FSAL
Switch between full screen mode and window mode
Prepare the drawing canvas
Start drawing
Ends drawing
Display the drawn contents on the screen
Draw an image on the background visible outside the main screen.
Use before fsal_drawstart(canvas).
Initialize FSAL with the current window width and height.
The startup state is fixed to window mode.
Prepare a canvas for FSAL and start drawing on it.
Finish drawing on the canvas for FSAL, and display what you have drawn on the fore screen.
When the F11 key is pressed, it toggles between windowed and full screen mode.
Call this in love.keypressed(key) and pass key directly to this function.
If you want to draw outside the game screen area in full screen mode,
you can call this function to get the current screen coordinates.
Calling this function returns whether the screen is currently full screen or not.
Convert the actual coordinates to virtual coordinates of the resolution set by the game.
Convert the virtual coordinates of the resolution set by the game to actual coordinates.
Obtain the magnification rate at the time of the call.
Change the FSAL calculation screen size.
Must be called passing w=width and h=height from love.resize(w, h).
Reset the window size to the FSAL canvas size.
Toggles whether or not the mouse cursor is clipped within the game area.
Adjusts the coordinates of the mouse cursor within the game area.
x, y can be given as the mouse coordinates from which the calculation is made.
If x and y are not given, the mouse coordinates are obtained and calculated.
The mouse cursor automatically moves to the correction position.
If you simply want the coordinates, use getvirtualmouse(x, y) instead.
It is unstable when used in LÖVE mouse-related callbacks.
Use getvirtualmouse(x, y) in mouse-related callbacks.
Get mouse coordinates corrected to the game canvas size.
require("fullscreen")
function love.load()
fsal_initialize(800, 600, false)
canvas = fsal_canvas()
bg = love.graphics.newImage("bg.jpg")
end
function love.draw()
fsal_drawbgimage(bg)
fsal_drawstart(canvas)
<draw anything here>
fsal_drawend()
fsal_show(canvas)
end
function love.keypressed(key)
if key == "f11" then
fsal_modechange()
end
end
require("fullscreen")
function love.load()
fsal_simpleinit()
end
function love.draw()
fsal_begindraw()
<draw anything here>
fsal_showcanvas()
end
function love.keypressed(key)
fsal_simplechange(key)
end
Copyright (C) 2020-2024 michyo (Michiyo Tagami) [https://michyo.net/]
Released under the MOUSEY license
See the LICENSE.txt for more details.
This license is almost identical to the MIT license.
The only difference is that I love mice very much.
There is no inconvenience for you that differs from an MIT license.
Please read LICENSE.txt for more information.