Search found 105 matches
- Sun Jan 28, 2018 8:30 am
- Forum: Support and Development
- Topic: Weird bug ?
- Replies: 2
- Views: 1989
Weird bug ?
function touch() t = lt.getTouches() if #t < 2 then for i,v in pairs(t) do ix, iy = lt.getPosition(v) end end end function touched() t = lt.getTouches() if #t > 0 then return true end end function love.load() lg = love.graphics lt = love.touch lg.setBackgroundColor(255,255,255) ix = 0 iy = 0 pos = ...
- Sat Jan 27, 2018 11:59 am
- Forum: Support and Development
- Topic: Screen resolution across multiple Android device
- Replies: 2
- Views: 1968
Re: Screen resolution across multiple Android device
Use libraries like CScreen if you are working with touch position
- Tue Nov 21, 2017 11:20 am
- Forum: Support and Development
- Topic: multiple function arguments
- Replies: 4
- Views: 3263
Re: multiple function arguments
The problem is that you can only have varargs as the last argument(s). So if you rewrite your function like this, it won't error: function poly(color, ...) local edges = {...} end (Note that color is already a local, as it is an argument, so 'local color = color' doesn't actually do anything useful...
- Tue Nov 21, 2017 10:50 am
- Forum: Support and Development
- Topic: multiple function arguments
- Replies: 4
- Views: 3263
multiple function arguments
so i wanna make a function to generate polygon with color, it looks like this
even when i dont run the function, i got an error already, how can i achieve this ?
Code: Select all
function poly(... , color)
local edges = {...}
local color = color
end
- Wed Nov 08, 2017 1:07 pm
- Forum: Support and Development
- Topic: setting center of rotation
- Replies: 2
- Views: 2427
- Wed Nov 08, 2017 1:05 pm
- Forum: Support and Development
- Topic: math help
- Replies: 5
- Views: 5333
math help
so i wanna rotate something around a point, just like orbiting around it, i found some formulas.. but its just too long, i remembered a formula with only sin and cos, times it by radius and it works.. also maintaining the current position, but i forgot the formula already x = math.sin(math.rad(angle...
- Sun Nov 05, 2017 12:36 pm
- Forum: Support and Development
- Topic: setting center of rotation
- Replies: 2
- Views: 2427
setting center of rotation
so i am using a camera library, it looks like this,
function love.camera.setAngle(dr)
love.camera.rotation = dr
end
so i dont know the math to make everything rotate in the middle instead of the upper left corner, help ?
function love.camera.setAngle(dr)
love.camera.rotation = dr
end
so i dont know the math to make everything rotate in the middle instead of the upper left corner, help ?
- Sat Nov 04, 2017 2:11 pm
- Forum: Support and Development
- Topic: saving on android
- Replies: 0
- Views: 1178
saving on android
so im saving using love.filesystem, it works fine on windows, but got an error after exporting to android, it uses the same exact path on windows after i exported it to android, resulting in error, are there any tutorials on saving in android ?
EDIT: fixed with love.filesystem.getSaveDirectory
EDIT: fixed with love.filesystem.getSaveDirectory
- Sat Oct 28, 2017 11:43 pm
- Forum: Support and Development
- Topic: ads on android
- Replies: 4
- Views: 3453
Re: ads on android
I recommend that you try this library: https://love2d.org/forums/viewtopic.php?f=5&t=84226&p=214482 And if you have some trouble, post it here and we will help you :) i am exporting using this tutorial, https://youtu.be/TAZo-pin4nE is it still possible ? because seems like i need to downloa...
- Sat Oct 28, 2017 8:13 am
- Forum: Support and Development
- Topic: ads on android
- Replies: 4
- Views: 3453
ads on android
is there any step by step tutorial ? found some, but really hard to understand