initial commit
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# love2d-vn-engine
|
||||
## Running
|
||||
With love2d installed:
|
||||
```love .```
|
||||
BIN
assets/images/imp.png
Normal file
BIN
assets/images/imp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 B |
33
main.lua
Normal file
33
main.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
function love.load()
|
||||
--target height/width
|
||||
_default_width = 480
|
||||
_default_height = 272
|
||||
-- window settings
|
||||
love.window.setMode(_default_width, _default_height, {resizable=true})
|
||||
--load images
|
||||
love.graphics.setDefaultFilter("nearest", "nearest") --fixes scaling; must be done before image loads remove if you want aliasing on scaling
|
||||
imp = love.graphics.newImage("assets/images/imp.png")
|
||||
--setup canvas
|
||||
canvas = love.graphics.newCanvas(_default_width, _default_height)
|
||||
end
|
||||
|
||||
function love.update()
|
||||
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
--draws should happen in here
|
||||
love.graphics.setCanvas(canvas)
|
||||
love.graphics.clear(0, 0, 0, 0)
|
||||
love.graphics.setBlendMode("alpha")
|
||||
love.graphics.print("Hello World", 100, 100)
|
||||
love.graphics.draw(imp, 50,50)
|
||||
love.graphics.setCanvas()
|
||||
--get canvas scale
|
||||
local w_width, w_height = love.graphics.getDimensions()
|
||||
local s_width = w_width / _default_width
|
||||
local s_height = w_height / _default_height
|
||||
local scale = math.min(s_width, s_height);
|
||||
love.graphics.setBlendMode("alpha", "premultiplied")
|
||||
love.graphics.draw(canvas,0,0,0, scale, scale)
|
||||
end
|
||||
8
vn-scene.txt
Normal file
8
vn-scene.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
[bg: bgImage]
|
||||
[c1: juniIdle]
|
||||
#juni
|
||||
> This is a test Script.
|
||||
> Im not sure about it.\n But its a test
|
||||
[c2: branchIdle]
|
||||
#branch
|
||||
> a test is a decent place to start
|
||||
Reference in New Issue
Block a user