Skip to content

Commit

Permalink
fixed touch gamepad button shape (now square)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneSchwettmann committed Mar 23, 2017
1 parent 874d028 commit 3e7bc0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Input.lua
Expand Up @@ -13,8 +13,8 @@ function getInputPlayer(playerNumber)
local width = love.graphics.getWidth()
local height = love.graphics.getHeight()
-- relative (square) button size
local dPadButtonSizeX = 0.15*width
local dPadButtonSizeY = 0.15*height
local dPadButtonSizeX = 0.1*width
local dPadButtonSizeY = dPadButtonSizeX
-- top left coordinate of virtual gamepad
local dPadTopLeftX=0
local dPadTopLeftY=height-3*dPadButtonSizeY
Expand All @@ -25,8 +25,8 @@ function getInputPlayer(playerNumber)
xInput = i-2
yInput = j-2
end
local fireButtonSizeX = 0.45*width
local fireButtonSizeY = 0.45*height
local fireButtonSizeX = 0.3*width
local fireButtonSizeY = fireButtonSizeX
-- large virtual firebutton on the bottom right
local fireButtonTopLeftX=width-fireButtonSizeX
local fireButtonTopLeftY=height-fireButtonSizeY
Expand Down

0 comments on commit 3e7bc0b

Please sign in to comment.