From 90d4c7ecc79544e932241b6befa587da425e4688 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Mon, 20 Jun 2016 19:57:45 -0700 Subject: Code to scale tentacles for different monitor sizes --- desktop.lua | 16 ++++++++-------- main.lua | 2 ++ var.lua | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/desktop.lua b/desktop.lua index e9862af..d3819af 100644 --- a/desktop.lua +++ b/desktop.lua @@ -34,13 +34,13 @@ function drawDesktop() end if scene == 2 and v1.c.chat.msgs > 35 then love.graphics.setColor(0,0,0,100) - love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2,sys.h) - love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2,sys.h) + love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2*sys.sw,sys.h*sys.sw) + love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2*sys.sw,sys.h) drawTentacles() removeTentacles() love.graphics.setColor(0,0,0,235) - love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2,sys.h) - love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2,sys.h) + love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2*sys.sw,sys.h) + love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2*sys.sw,sys.h) end for i=1,6 do drawIcon(i) @@ -135,15 +135,15 @@ function drawTentacles() end if v1.t.t[i].si == 0 then if v1.t.t[i].t == 1 then - love.graphics.draw(v1.tent1,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16) + love.graphics.draw(v1.tent1,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s*sys.sh,v1.t.t[i].sy*sys.sw+v1.t.t[i].syc,16) elseif v1.t.t[i].t == 2 then - love.graphics.draw(v1.tent2,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16) + love.graphics.draw(v1.tent2,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s*sys.sh,v1.t.t[i].sy*sys.sw+v1.t.t[i].syc,16) end elseif v1.t.t[i].si == 1 then if v1.t.t[i].t == 1 then - love.graphics.draw(v1.tent1,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16) + love.graphics.draw(v1.tent1,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s*sys.sh,v1.t.t[i].sy*sys.sw+v1.t.t[i].syc,16) elseif v1.t.t[i].t == 2 then - love.graphics.draw(v1.tent2,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16) + love.graphics.draw(v1.tent2,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s*sys.sh,v1.t.t[i].sy*sys.sw+v1.t.t[i].syc,16) end end if v1.t.t[i].d == false and v1.c.chat.msgs <= 40 then diff --git a/main.lua b/main.lua index 0fe3aaf..6b715a7 100644 --- a/main.lua +++ b/main.lua @@ -25,6 +25,8 @@ function love.update(dt) sys.s = 60/fps sys.w = love.graphics.getWidth() sys.h = love.graphics.getHeight() + sys.sw = sys.w/1920 + sys.sh = sys.h/1080 minim = sys.h+10 sys.mouse.x = love.mouse.getX() sys.mouse.y = love.mouse.getY() diff --git a/var.lua b/var.lua index 1612f01..eb74f23 100644 --- a/var.lua +++ b/var.lua @@ -173,7 +173,7 @@ function loadVar() v1.t = {} v1.t.time = 0 v1.t.t = {} - v1.t.x = -1000 + v1.t.x = -1000*sys.sw expl.deb[1].x = 0 expl.deb[1].y = 0 expl.deb[1].ym = 5 -- cgit