Search found 65 matches

by HDPLocust
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 ...
by HDPLocust
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(....
by HDPLocust
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 ...
by HDPLocust
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)
by HDPLocust
Mon May 27, 2019 9:34 am
Forum: Support and Development
Topic: Polygon render errors [v11.2] [SOLVED]
Replies: 4
Views: 4627

Re: Polygon render errors [v11.2]

TheHUG wrote: Sun May 26, 2019 7:08 pm Why do you want to avoid triangulation?
Yea, it sometimes can't triangulate, so I use meshes now.
by HDPLocust
Sun May 26, 2019 4:39 pm
Forum: Support and Development
Topic: Polygon render errors [v11.2] [SOLVED]
Replies: 4
Views: 4627

Re: Polygon render errors [v11.2]

zorg wrote: Sun May 26, 2019 4:33 pm So unless you make it so it's convex and simple from the get-go, you will always need to triangulate it.
Ah, my bad. But this is bad too, hmm.
by HDPLocust
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...
by HDPLocust
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.
by HDPLocust
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'; ...