How To Load Images in Love2D with Lua: Learn Programming and Game Development with Lua

Опубликовано: 10 Март 2026
на канале: Charles Kirk
376
15

In this video in my series Learn Programming and Game Development with Lua I demonstrate how to configure the Love2D game framework and how to load an image in Love2D with Lua.

#programming #gamedevelopment #gamedev #lua #love2d

00:00 - Start
00:06 - Introduction
01:53 - Setting up the LÖVE Love2D project in ZeroBrane Studio.
02:54 - Conf Files in LÖVE Love2D.
05:44 - Getting Some 2D Game Assets
08:36 - Quicklook Utility for previewing files.
09:49 - Adding the Callback Functions required for project.
10:34 - The best place to load an image in your code.
11:07 - Loading an image in the love.load() callback function.
12:16 - Drawing the image in love.draw()
12:34 - Getting the dimension of an image.
14:40 - Outputting the image dimensions in realtime.
15:53 - Outputing the image dimensions to the ZeroBrane Studio IDE Output window.
18:31 - Using getDimensions() instead of getWidth() and getHeight()

Link to the complete code for this tutorial on GitHub:
https://github.com/CharlesKirkSD/Lear...

Turn LÖVE buffering off so that anything output with print() is output immediately:
https://studio.zerobrane.com/doc-faq#...
Code Snippet:
io.stdout:setvbuf("no")