From 6201455b32dee57659bc8bb0f0fc4aff6f34c081 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Thu, 21 Jul 2016 22:52:23 -0700 Subject: Added Document viewer --- assets.lua | 3 ++- assets/icon_16_document.png | Bin 0 -> 244 bytes var.lua | 4 ++++ viewer.lua | 9 +++++++++ window.lua | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 assets/icon_16_document.png diff --git a/assets.lua b/assets.lua index 5114dd1..6ef8212 100644 --- a/assets.lua +++ b/assets.lua @@ -21,7 +21,8 @@ function loadAssets(id) antivirus = love.graphics.newImage("assets/icon_16_antivirus.png"), image = love.graphics.newImage("assets/icon_16_image.png"), video = love.graphics.newImage("assets/icon_16_video.png"), - music = love.graphics.newImage("assets/icon_16_music.png") + music = love.graphics.newImage("assets/icon_16_music.png"), + document = love.graphics.newImage("assets/icon_16_document.png") } end if id == 3 then diff --git a/assets/icon_16_document.png b/assets/icon_16_document.png new file mode 100644 index 0000000..2d0c6bb Binary files /dev/null and b/assets/icon_16_document.png differ diff --git a/var.lua b/var.lua index 09b6224..19196a8 100644 --- a/var.lua +++ b/var.lua @@ -61,6 +61,7 @@ function loadVar() loadWin(7, 400, 400, "Image Viewer", nil, icons[16].image) loadWin(8, 400, 300, "Video Player", nil, icons[16].video) loadWin(9, 250, 150, "Music Player", nil, icons[16].music) + loadWin(10, 350, 500, "Document Viewer", nil, icons[16].document) win[4].crazy = false win[4].crazyLeft = false win[4].crazyUp = false @@ -265,6 +266,9 @@ function loadVar() file.p = false file.back = false picture.img = 0 + doc = {} + doc.doc = "" + loadDocuments() mplay = {} mplay.volx = 232 mplay.volpx = mplay.volx diff --git a/viewer.lua b/viewer.lua index 26074ca..4e51729 100644 --- a/viewer.lua +++ b/viewer.lua @@ -1,3 +1,12 @@ +function drawDocuments() + drawDownBox(8, 31, win[10].w-17, win[10].h-40, 4) + love.graphics.setColor(256,256,256) + love.graphics.rectangle("fill", 8, 31, win[10].w-17, win[10].h-40) + love.graphics.setFont(pixeloperators) + love.graphics.setColor(colors.font.dark) + love.graphics.printf(doc.doc, 8+30, 31+30, win[10].w-17-60, "left") + love.graphics.setFont(pressstart) +end function drawPicture() drawDownBox(8, 31, win[7].w-17, win[7].h-40, 4) if picture.img ~= 0 then diff --git a/window.lua b/window.lua index 3c4722a..dd38c99 100644 --- a/window.lua +++ b/window.lua @@ -32,6 +32,8 @@ function drawWindow(id) drawMusic() elseif id == 8 then drawVideo() + elseif id == 10 then + drawDocuments() end love.graphics.setCanvas() win[id].update = false -- cgit