forked from yjgaia/DicepartmentStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
41 lines (35 loc) · 822 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require('ULUA/ULUA-LOVE')
RESIZE_WIN({
width = 960,
height = 540,
isResizable = true
})
SET_BACKGROUND({
color = '#ffffff'
})
local image
function createImage()
image = love.graphics.newImage('dice-'..RANDOM({
min = 1,
max = 6
})..'.png')
end
createImage()
function love.load()
canvas = love.graphics.newCanvas(480, 540)
love.graphics.setCanvas(canvas)
love.graphics.clear()
love.graphics.setBlendMode("alpha")
love.graphics.setColor(255, 0, 0, 128)
love.graphics.rectangle('fill', 0, 0, 100, 100)
love.graphics.setCanvas()
end
function love.draw()
love.graphics.draw(canvas)
love.graphics.draw(image, 480, 100, 0, 1, 1, image:getWidth() / 2, image:getHeight() / 2)
end
function love.mousepressed(x, y, button, isTouch)
if button == 1 then
createImage()
end
end