aboutsummaryrefslogtreecommitdiff
path: root/libs/sti/graphics.lua
blob: 6acf8d6325558d68730b750fff9f76c74789432c (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
local lg       = _G.love.graphics
local graphics = { isCreated = lg and true or false }

function graphics.newSpriteBatch(...)
	if graphics.isCreated then
		return lg.newSpriteBatch(...)
	end
end

function graphics.newCanvas(...)
	if graphics.isCreated then
		return lg.newCanvas(...)
	end
end

function graphics.newImage(...)
	if graphics.isCreated then
		return lg.newImage(...)
	end
end

function graphics.newQuad(...)
	if graphics.isCreated then
		return lg.newQuad(...)
	end
end

function graphics.getCanvas(...)
	if graphics.isCreated then
		return lg.getCanvas(...)
	end
end

function graphics.setCanvas(...)
	if graphics.isCreated then
		return lg.setCanvas(...)
	end
end

function graphics.clear(...)
	if graphics.isCreated then
		return lg.clear(...)
	end
end

function graphics.push(...)
	if graphics.isCreated then
		return lg.push(...)
	end
end

function graphics.origin(...)
	if graphics.isCreated then
		return lg.origin(...)
	end
end

function graphics.scale(...)
	if graphics.isCreated then
		return lg.scale(...)
	end
end

function graphics.translate(...)
	if graphics.isCreated then
		return lg.translate(...)
	end
end

function graphics.pop(...)
	if graphics.isCreated then
		return lg.pop(...)
	end
end

function graphics.draw(...)
	if graphics.isCreated then
		return lg.draw(...)
	end
end

function graphics.rectangle(...)
	if graphics.isCreated then
		return lg.rectangle(...)
	end
end

function graphics.getColor(...)
	if graphics.isCreated then
		return lg.getColor(...)
	end
end

function graphics.setColor(...)
	if graphics.isCreated then
		return lg.setColor(...)
	end
end

function graphics.line(...)
	if graphics.isCreated then
		return lg.line(...)
	end
end

function graphics.polygon(...)
	if graphics.isCreated then
		return lg.polygon(...)
	end
end

function graphics.points(...)
	if graphics.isCreated then
		return lg.points(...)
	end
end

function graphics.getWidth()
	if graphics.isCreated then
		return lg.getWidth()
	end
	return 0
end

function graphics.getHeight()
	if graphics.isCreated then
		return lg.getHeight()
	end
	return 0
end

return graphics