Search found 248 matches

by arampl
Mon Nov 09, 2015 2:48 pm
Forum: Support and Development
Topic: insantly stop a body in love.physics
Replies: 10
Views: 4080

Re: insantly stop a body in love.physics

I think you should split the last line into two:

Code: Select all

player.fixture = love.physics.newFixture(player.body, player.shape)
player.fixture:setUserData("player")
Then you'll be able to use setFriction with player.fixture.
by arampl
Mon Nov 09, 2015 1:17 pm
Forum: Support and Development
Topic: insantly stop a body in love.physics
Replies: 10
Views: 4080

Re: insantly stop a body in love.physics

Then more code needed. ":setFriction(1)" is not enough. What else can give you nil? Of course not "1". And "setFriction" is the right name for the method.
by arampl
Mon Nov 09, 2015 11:51 am
Forum: Support and Development
Topic: insantly stop a body in love.physics
Replies: 10
Views: 4080

Re: insantly stop a body in love.physics

Maybe object before colon is not fixture?
by arampl
Tue Nov 03, 2015 3:42 am
Forum: Support and Development
Topic: Help with this shader, please?
Replies: 2
Views: 2238

Re: Help with this shader, please?

Seems you forgot draw something to canvas2. You set shader, send uniforms to it, then leave and draw black screen. Maybe you need to put "love.graphics.draw(canvas1)" after shader:send("iChannel0", canvas1) or something like this? btw. You can use love.update event for drawing op...
by arampl
Sat Oct 31, 2015 4:26 am
Forum: Support and Development
Topic: How to implement syntax highlighting
Replies: 9
Views: 4434

Re: How to implement syntax highlighting

...if I use that ".[\128-\191]*" it separates everything by individual character. ... Visible part of text is splitted to words by analysing each individual character. If it is one of the separators it is added to a table as a new word, else it continues to append next character to the cu...
by arampl
Fri Oct 30, 2015 3:13 pm
Forum: Support and Development
Topic: How to implement syntax highlighting
Replies: 9
Views: 4434

Re: How to implement syntax highlighting

OK, guys. Here you go. You need to use LÖVE v.0.10.0 to run .love file. Code is ugly, not consistent, uncommented, etc. It was just an experiment with GUI and text handling. EDIT: text selection, undo/redo not implemented yet. Clipboard supported. You can also fold code then ctrl-x/c/v. LICENSE: no ...
by arampl
Thu Oct 29, 2015 12:55 am
Forum: Support and Development
Topic: How to implement syntax highlighting
Replies: 9
Views: 4434

Re: How to implement syntax highlighting

Text is UTF-8 so I'm using "gmatch(".[\128-\191]*")" to check for spaces, tabs, etc.
And separator for tab is ["\t"].
Quotes still not implemented fully in my code. Right now it's just switching state after each quote then checks current state.
by arampl
Wed Oct 28, 2015 4:47 pm
Forum: Support and Development
Topic: How to implement syntax highlighting
Replies: 9
Views: 4434

Re: How to implement syntax highlighting

I'm using approach from PIL: local function Set(list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end local keywords = Set{"and", "break", "do", "else", "elseif", "end", "false", "for", "...
by arampl
Sun Oct 18, 2015 3:41 pm
Forum: General
Topic: love.graphics.setStencil not applying over canvases?
Replies: 6
Views: 2078

Re: love.graphics.setStencil not applying over canvases?

Oh, I've thought question was about problems inside .love.
by arampl
Sun Oct 18, 2015 2:31 pm
Forum: General
Topic: love.graphics.setStencil not applying over canvases?
Replies: 6
Views: 2078

Re: love.graphics.setStencil not applying over canvases?

It seems that setting / unsetting canvases cancels any defined stencils in 0.9.2: local lg = love.graphics local canvas function love.load() canvas = lg.newCanvas(800, 600) end function love.draw() lg.setStencil(function() lg.rectangle("fill", 100, 100, 200, 200) end) lg.setCanvas() lg.set...