Compare commits
4 Commits
b050a985ba
...
5637cea623
Author | SHA1 | Date | |
---|---|---|---|
5637cea623 | |||
5c18f2cd44 | |||
b55f024473 | |||
4a734ffac4 |
|
@ -1,8 +1,29 @@
|
||||||
|
# WARNING!
|
||||||
|
# THIS IS AN AUTOGENERATED FILE!
|
||||||
|
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
|
||||||
|
|
||||||
name: LÖVE/Lua Library
|
name: LÖVE/Lua Library
|
||||||
on: [push]
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore: ['README.md', '.gitignore', 'LICENSE', 'CONVENTIONS.md']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Test:
|
Lua-Testing:
|
||||||
uses: jmaa/workflows/.gitea/workflows/lua-testing.yaml@v6.21
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Lua
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y luajit
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Run testing library
|
||||||
|
run: luajit test/init.lua
|
||||||
Static-Analysis:
|
Static-Analysis:
|
||||||
uses: jmaa/workflows/.gitea/workflows/lua-static-analysis.yaml@v6.21
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Luacheck linter
|
||||||
|
uses: https://github.com/lunarmodules/luacheck@v1.1.1
|
||||||
|
|
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# WARNING!
|
||||||
|
# THIS IS AN AUTOGENERATED FILE!
|
||||||
|
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
|
||||||
|
|
||||||
|
# Löve: Exclude build items
|
||||||
|
/bin/
|
||||||
|
/lib/
|
||||||
|
.love-cache/
|
||||||
|
|
||||||
|
# Compiled Lua sources
|
||||||
|
luac.out
|
||||||
|
|
||||||
|
# Misc (Image, MacOS, Backups) files
|
||||||
|
*.psd
|
||||||
|
*~
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Tools
|
||||||
|
*.tiled-session
|
|
@ -1,3 +1,7 @@
|
||||||
|
-- WARNING!
|
||||||
|
-- THIS IS AN AUTOGENERATED FILE!
|
||||||
|
-- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
|
||||||
|
|
||||||
std = "love+max"
|
std = "love+max"
|
||||||
cache = true
|
cache = true
|
||||||
include_files = {"**.lua", "*.luacheckrc"}
|
include_files = {"**.lua", "*.luacheckrc"}
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,3 +1,3 @@
|
||||||
Copyright (c) 2018-2024 Jon Michael Aanes
|
Copyright (c) 2018-2025 Jon Michael Aanes
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
22
README.md
22
README.md
|
@ -1,6 +1,6 @@
|
||||||
<!--- WARNING --->
|
<!-- WARNING! -->
|
||||||
<!--- THIS IS AN AUTO-GENERATED FILE --->
|
<!-- THIS IS AN AUTOGENERATED FILE! -->
|
||||||
<!--- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN --->
|
<!-- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN! -->
|
||||||
|
|
||||||
# Spritesheet
|
# Spritesheet
|
||||||
|
|
||||||
|
@ -14,11 +14,23 @@ can be specified from a lua file placed beside the spritesheet image file.
|
||||||
- When drawing an image or animation when a shader is defined the library may
|
- When drawing an image or animation when a shader is defined the library may
|
||||||
send certain useful constants along, notably `spritesheet_inverse_width` and
|
send certain useful constants along, notably `spritesheet_inverse_width` and
|
||||||
`spritesheet_inverse_height`.
|
`spritesheet_inverse_height`.
|
||||||
|
- Checks that LÖVE is defined; if not, run in information loading
|
||||||
|
mode only.
|
||||||
|
|
||||||
# License
|
## Dependencies
|
||||||
|
|
||||||
|
This project requires [PUC Lua 5.1](https://www.tecgraf.puc-rio.br/lua/mirror/versions.html#5.1) or [LuaJIT](https://luajit.org/luajit.html). Newer versions of PUC Lua are not supported.
|
||||||
|
|
||||||
|
This project does not have any library requirements 😎
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Feel free to submit pull requests. Please follow the [Code Conventions](CONVENTIONS.md) when doing so.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright (c) 2018-2024 Jon Michael Aanes
|
Copyright (c) 2018-2025 Jon Michael Aanes
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
```
|
```
|
||||||
|
|
9
init.lua
9
init.lua
|
@ -1,5 +1,6 @@
|
||||||
local _VERSION = '0.1.3'
|
-- WARNING!
|
||||||
|
-- THIS IS AN AUTOGENERATED FILE!
|
||||||
|
-- MANUAL CHANGES CAN AND WILL BE OVERWRITTEN!
|
||||||
|
|
||||||
local lib = require ((...) .. '.spritesheet')
|
-- This file automatically redirects to "spritesheet.lua"
|
||||||
lib._VERSION = _VERSION
|
return require (((...) ~= 'init' and (...) .. '.' or '') .. 'spritesheet')
|
||||||
return lib
|
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
--[[-- # Spritesheet
|
--- # Spritesheet
|
||||||
|
--
|
||||||
|
-- Library for managing sprite sheets of textures and animations.
|
||||||
|
--
|
||||||
|
-- Has support for both individual images in spritesheets and animations. This
|
||||||
|
-- can be specified from a lua file placed beside the spritesheet image file.
|
||||||
|
--
|
||||||
|
-- ## Notes
|
||||||
|
--
|
||||||
|
-- - When drawing an image or animation when a shader is defined the library may
|
||||||
|
-- send certain useful constants along, notably `spritesheet_inverse_width` and
|
||||||
|
-- `spritesheet_inverse_height`.
|
||||||
|
-- - Checks that LÖVE is defined; if not, run in information loading
|
||||||
|
-- mode only.
|
||||||
|
|
||||||
Library for managing sprite sheets of textures and animations.
|
local _VERSION = '0.1.3'
|
||||||
|
|
||||||
Has support for both individual images in spritesheets and animations. This
|
|
||||||
can be specified from a lua file placed beside the spritesheet image file.
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
- When drawing an image or animation when a shader is defined the library may
|
|
||||||
send certain useful constants along, notably `spritesheet_inverse_width` and
|
|
||||||
`spritesheet_inverse_height`.
|
|
||||||
--]]
|
|
||||||
|
|
||||||
local error_original = error
|
local error_original = error
|
||||||
local error, error_internal do
|
local error, error_internal do
|
||||||
|
@ -23,8 +26,6 @@ local error, error_internal do
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Checks that LÖVE is defined; if not, run in information loading
|
|
||||||
-- mode only.
|
|
||||||
|
|
||||||
local define_love = true
|
local define_love = true
|
||||||
if type(love) ~= 'table' then
|
if type(love) ~= 'table' then
|
||||||
|
@ -349,6 +350,7 @@ end
|
||||||
local SpriteSheet = {}
|
local SpriteSheet = {}
|
||||||
SpriteSheet.__index = SpriteSheet
|
SpriteSheet.__index = SpriteSheet
|
||||||
SpriteSheet.is_spritesheet = true
|
SpriteSheet.is_spritesheet = true
|
||||||
|
SpriteSheet._VERSION = _VERSION
|
||||||
|
|
||||||
function SpriteSheet.new (filename)
|
function SpriteSheet.new (filename)
|
||||||
local quad_data = load_quad_data(filename)
|
local quad_data = load_quad_data(filename)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user