Search found 65 matches
- Tue Jan 07, 2020 7:57 am
- Forum: Support and Development
- Topic: [SOLVED] How do I import files from specific folder in the game directory?
- Replies: 5
- Views: 4657
Re: [SOLVED] How do I import files from specific folder in the game directory?
You sould use [\\] (it's regular backslash character). Backslash is the escape character in lua strings: print("Backslash is here \\") --> Backslash is here \ Also multiline/unescaped strings can be achived with [[]] syntax: print([[Backslash is here \]]) --> Backslash is here \ Backslash ...
- Tue Jan 07, 2020 7:39 am
- Forum: Support and Development
- Topic: Selecting multiple functions in one class depending on the modificator/table index
- Replies: 5
- Views: 5963
Re: Selecting multiple functions in one class depending on the modificator/table index
I think, the better way it's simple OOP inheritance. local Enemy = Class('enemy') -- main class function Enemy:init(...) ... end function Enemy:update(dt) ... end -- basic behavior function Enemy:draw() ... end local FlyingEnemy = Class(Enemy, 'estrong') -- children class function FlyingEnemy:init(....
- Sat Dec 21, 2019 6:11 pm
- Forum: Support and Development
- Topic: Are sprite batches the solution to my low FPS?
- Replies: 3
- Views: 4413
Re: Are sprite batches the solution to my low FPS?
Every call of love.graphics.draw it's two-part process: 1. Send data to GPU (image + verticies + transform info, it's slow) 2. Draw data by GPU (it's mostly fast, if you don't use heavy shaders) Love2d have autobatching, so if you send one image a lot of times in a row, it may be transformed to one ...
- Thu Jul 04, 2019 8:17 am
- Forum: Support and Development
- Topic: rectangles in line mode
- Replies: 3
- Views: 4189
Re: rectangles in line mode
Also you can love.graphics.translate(.5, .5) before rendering stuff (except text, it nicely renders with round coords)
- Mon May 27, 2019 9:34 am
- Forum: Support and Development
- Topic: Polygon render errors [v11.2] [SOLVED]
- Replies: 4
- Views: 4627
- Sun May 26, 2019 4:39 pm
- Forum: Support and Development
- Topic: Polygon render errors [v11.2] [SOLVED]
- Replies: 4
- Views: 4627
- Sun May 26, 2019 2:59 pm
- Forum: Support and Development
- Topic: Polygon render errors [v11.2] [SOLVED]
- Replies: 4
- Views: 4627
Polygon render errors [v11.2] [SOLVED]
Hmm, it like render error (with non-convex polygons), how it can be solved without triangulation? It's just this love.graphics.polygon('fill', polygon_table) -- every point tries to make triangle with first point in list -- and love.graphics.polygon('line', polygon_table) -- drawed correctly nothing...
- Fri May 17, 2019 12:10 am
- Forum: Support and Development
- Topic: Android language
- Replies: 6
- Views: 6033
Re: Android language
You can use locale shell command, but no guarantees. It's ok, don't use it, just ask user about preferred language at first launch. It's better way, srsly.
- Mon May 13, 2019 1:39 pm
- Forum: Support and Development
- Topic: Convert character into a integer number from 1-255 [Solved]
- Replies: 4
- Views: 3237
Re: Convert character into a integer number from 1-255 [Solved]
Your questions about lua, not love2d. Read the book: http://www.lua.org/manual/5.1/
- Fri May 10, 2019 10:17 pm
- Forum: Support and Development
- Topic: How to send email via smtp?
- Replies: 2
- Views: 2072
Re: How to send email via smtp?
Write ssl-wrapper around socket.smtp with luasec. Or use http-backend that sends mail and http requests. Php example for backend <?php $message = file_get_contents('php://input'); $message = wordwrap($message, 70, "\r\n"); mail('[user]@[domain].com', 'message topic', $message); echo 'OK'; ...