aboutsummaryrefslogtreecommitdiff
path: root/bin/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'bin/main.lua')
-rw-r--r--bin/main.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/main.lua b/bin/main.lua
index 190c644..3231705 100644
--- a/bin/main.lua
+++ b/bin/main.lua
@@ -39,7 +39,7 @@ local jg = jin.graphics
local effect = jg.Shader(shader)
local diffuse = jg.Image("treestump_diffuse.png")
local img = jg.Image("treestump.png")
-
+local ww, wh = jg.size()
jin.core.onEvent = function(e)
if e.type == "quit" then
jin.core.quit()
@@ -48,15 +48,14 @@ end
jin.core.onUpdate = function()
local mx, my = jin.mouse.position()
- my = 400 - my
+ my = wh - my
effect:send("number", "mx", mx)
effect:send("number", "my", my)
end
jin.core.onDraw = function()
- effect:send("Image", "diffuse", diffuse);
jg.use(effect)
+ effect:send("Image", "diffuse", diffuse);
img:setAnchor(16, 16)
- jg.draw(img, 250, 200, 5, 5)
-
+ jg.draw(img, 250, 200, 2, 2)
end