mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
just some reformatting
This commit is contained in:
parent
1c5eb2c804
commit
c370e9ecc2
@ -1,5 +1,4 @@
|
|||||||
extern Image glowImage;
|
extern Image glowImage;
|
||||||
|
|
||||||
extern float glowTime;
|
extern float glowTime;
|
||||||
|
|
||||||
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords) {
|
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords) {
|
||||||
|
22
main.lua
22
main.lua
@ -49,7 +49,6 @@ function love.keypressed(k) end
|
|||||||
function love.keyreleased(k) end
|
function love.keyreleased(k) end
|
||||||
function love.mousepressed(x, y, b) end
|
function love.mousepressed(x, y, b) end
|
||||||
function love.mousereleased(x, y, b) end
|
function love.mousereleased(x, y, b) end
|
||||||
|
|
||||||
function exf.empty() end
|
function exf.empty() end
|
||||||
|
|
||||||
function exf.update(dt)
|
function exf.update(dt)
|
||||||
@ -163,8 +162,6 @@ function exf.clear()
|
|||||||
love.graphics.setColor(255, 255, 255)
|
love.graphics.setColor(255, 255, 255)
|
||||||
love.graphics.setLineWidth(1)
|
love.graphics.setLineWidth(1)
|
||||||
love.graphics.setLineStyle("smooth")
|
love.graphics.setLineStyle("smooth")
|
||||||
--love.graphics.setLine(1, "smooth")
|
|
||||||
--love.graphics.setColorMode("replace")
|
|
||||||
love.graphics.setBlendMode("alpha")
|
love.graphics.setBlendMode("alpha")
|
||||||
love.mouse.setVisible(true)
|
love.mouse.setVisible(true)
|
||||||
end
|
end
|
||||||
@ -278,7 +275,6 @@ function List:update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.bar_lock.y = love.mouse.getY()
|
self.bar_lock.y = love.mouse.getY()
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -296,10 +292,14 @@ function List:mousepressed(mx, my, b)
|
|||||||
|
|
||||||
if b == "wd" then
|
if b == "wd" then
|
||||||
self.bar_pos = self.bar_pos + bar_pixel_dt
|
self.bar_pos = self.bar_pos + bar_pixel_dt
|
||||||
if self.bar_pos > self.bar_max_pos then self.bar_pos = self.bar_max_pos end
|
if self.bar_pos > self.bar_max_pos then
|
||||||
|
self.bar_pos = self.bar_max_pos
|
||||||
|
end
|
||||||
elseif b == "wu" then
|
elseif b == "wu" then
|
||||||
self.bar_pos = self.bar_pos - bar_pixel_dt
|
self.bar_pos = self.bar_pos - bar_pixel_dt
|
||||||
if self.bar_pos < 0 then self.bar_pos = 0 end
|
if self.bar_pos < 0 then
|
||||||
|
self.bar_pos = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -323,14 +323,12 @@ function List:mousereleased(x, y, b)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function List:getBarRect()
|
function List:getBarRect()
|
||||||
return
|
return self.x+self.width+2, self.y+1+self.bar_pos,
|
||||||
self.x+self.width+2, self.y+1+self.bar_pos,
|
|
||||||
self.bar_width-3, self.bar_size
|
self.bar_width-3, self.bar_size
|
||||||
end
|
end
|
||||||
|
|
||||||
function List:getItemRect(i)
|
function List:getItemRect(i)
|
||||||
return
|
return self.x+2, self.y+((self.item_height+1)*(i-1)+1)-self:getOffset(),
|
||||||
self.x+2, self.y+((self.item_height+1)*(i-1)+1)-self:getOffset(),
|
|
||||||
self.width-3, self.item_height
|
self.width-3, self.item_height
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -346,8 +344,10 @@ function List:draw()
|
|||||||
-- Get interval to display.
|
-- Get interval to display.
|
||||||
local start_i = math.floor( self:getOffset()/(self.item_height+1) ) + 1
|
local start_i = math.floor( self:getOffset()/(self.item_height+1) ) + 1
|
||||||
local end_i = start_i+math.floor( self.height/(self.item_height+1) ) + 1
|
local end_i = start_i+math.floor( self.height/(self.item_height+1) ) + 1
|
||||||
if end_i > self.items.n then end_i = self.items.n end
|
|
||||||
|
|
||||||
|
if end_i > self.items.n then
|
||||||
|
end_i = self.items.n
|
||||||
|
end
|
||||||
|
|
||||||
love.graphics.setScissor(self.x, self.y, self.width, self.height)
|
love.graphics.setScissor(self.x, self.y, self.width, self.height)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user