Add documentation and change default to off.
35
README.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
Vignette
|
||||||
|
--------
|
||||||
|
|
||||||
|
A Minetest mod to place a vignette filter on the screen.
|
||||||
|
|
||||||
|
![Vignette Screenshot](screenshot.png "Vignette")
|
||||||
|
|
||||||
|
By David G (kestral246), based on the concept by TriBlade9.
|
||||||
|
|
||||||
|
How to enable
|
||||||
|
-------------
|
||||||
|
|
||||||
|
This mod defaults to not applying filter. To enable, use the chat command:
|
||||||
|
|
||||||
|
> "/vignette"
|
||||||
|
|
||||||
|
Repeated use of this command will toggle the effect off and on.
|
||||||
|
|
||||||
|
Licenses
|
||||||
|
--------
|
||||||
|
Source code
|
||||||
|
|
||||||
|
> The MIT License (MIT)
|
||||||
|
|
||||||
|
Media (textures)
|
||||||
|
|
||||||
|
>Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
8
init.lua
@ -2,7 +2,9 @@
|
|||||||
-- Adds a vignette filter to player's screen
|
-- Adds a vignette filter to player's screen
|
||||||
-- Based on concept by TriBlade9
|
-- Based on concept by TriBlade9
|
||||||
-- By David_G (kestral246@gmail.com)
|
-- By David_G (kestral246@gmail.com)
|
||||||
-- Includes chat command "/vignette", which toggles effect off or on
|
|
||||||
|
-- Don't enable vignette effect at start.
|
||||||
|
-- Use chat command "/vignette" to enable, and then to toggle effect off or on.
|
||||||
|
|
||||||
local vignette = {}
|
local vignette = {}
|
||||||
|
|
||||||
@ -11,13 +13,13 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
vignette[pname] = {
|
vignette[pname] = {
|
||||||
id = player:hud_add({
|
id = player:hud_add({
|
||||||
hud_elem_type = "image",
|
hud_elem_type = "image",
|
||||||
text = "vignette.png",
|
text = "blank.png",
|
||||||
position = {x=0, y=0},
|
position = {x=0, y=0},
|
||||||
scale = {x=-100, y=-100},
|
scale = {x=-100, y=-100},
|
||||||
alignment = {x=1, y=1},
|
alignment = {x=1, y=1},
|
||||||
offset = {x=0, y=0}
|
offset = {x=0, y=0}
|
||||||
}),
|
}),
|
||||||
enable = true }
|
enable = false }
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_chatcommand("vignette", {
|
minetest.register_chatcommand("vignette", {
|
||||||
|
2
mod.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
name = vignette
|
||||||
|
description = Add vignette filter over screen.
|
BIN
screenshot.png
Normal file
After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 42 KiB |