Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikuauahdark/love2d-tl
Teal Type Definitions for LÖVE
https://github.com/mikuauahdark/love2d-tl
Last synced: 2 months ago
JSON representation
Teal Type Definitions for LÖVE
- Host: GitHub
- URL: https://github.com/mikuauahdark/love2d-tl
- Owner: MikuAuahDark
- License: mit
- Created: 2020-06-23T13:57:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-21T14:39:36.000Z (about 2 years ago)
- Last Synced: 2024-10-15T06:06:26.507Z (3 months ago)
- Language: Lua
- Homepage:
- Size: 176 KB
- Stars: 35
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
love2d-tl
=====[![LOVE](https://img.shields.io/badge/L%C3%96VE-11.4-EA316E.svg)](http://love2d.org/)
[Teal type](https://github.com/teal-language/teal-types) definition for LÖVE, an *awesome* framework you can use to make 2D games in Lua. Based on definitions provided by [love-api](https://github.com/love2d-community/love-api).
Note that this does not include type definition of [bit](https://bitop.luajit.org/), [FFI](http://luajit.org/ext_ffi.html), LuaSocket, ENet, and utf8 libraries!
Blacklisted Functions
-----Lists of function (variants) that are currently blacklisted due to limitations in `generate_tl.lua`:
* [`love.audio.getEffect`](https://love2d.org/wiki/love.audio.getEffect)
* [`World:getCallbacks`](https://love2d.org/wiki/World:getCallbacks)
* [`World:getContactFilter`](https://love2d.org/wiki/World:getContactFilter)
* [`World:setCallbacks`](https://love2d.org/wiki/World:setCallbacks)
* [`World:setContactFilter`](https://love2d.org/wiki/World:setContactFilter)
* [`love.window.showMessageBox` 2nd variant](https://love2d.org/wiki/love.window.showMessageBox#Function_2)
Usage
-----You need to cast at various places due to Teal lacking record inheritance (see [#4](https://github.com/MikuAuahDark/love2d-tl/issues/4)). Example simple usage.
```lua
function love.load()
global myimage = love.graphics.newImage("path/to/image.png")
local imageW, imageH = (myimage as love.graphics.Texture):getDimensions()
print("Width", imageW, "Height", imageH)
endfunction love.draw()
love.graphics.draw(myimage as love.graphics.Drawable)
end
```