Better controller code
This commit is contained in:
@@ -4,12 +4,29 @@ local function getTextY(line)
|
||||
end
|
||||
|
||||
function love.draw2()
|
||||
local width, height = love.graphics.getDimensions()
|
||||
|
||||
-- Set background
|
||||
love.graphics.setBackgroundColor(0, 0, 0)
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
|
||||
-- Draw camera feed
|
||||
if BotState.camfeed then
|
||||
love.graphics.draw(BotState.camfeed)
|
||||
local imageWidth = BotState.camfeed:getWidth()
|
||||
local imageHeight = BotState.camfeed:getHeight()
|
||||
|
||||
local scaleWidth = width / imageWidth
|
||||
local scaleHeight = height / imageHeight
|
||||
local scale = math.min(scaleWidth, scaleHeight)
|
||||
|
||||
local scaledWidth = imageWidth * scale
|
||||
local scaledHeight = imageHeight * scale
|
||||
|
||||
love.graphics.draw(BotState.camfeed,
|
||||
(width - scaledWidth) / 2, (height - scaledHeight) / 2,
|
||||
0,
|
||||
scale, scale
|
||||
)
|
||||
end
|
||||
|
||||
-- Draw time
|
||||
|
||||
Reference in New Issue
Block a user