Search found 94 matches

by megalukes
Wed Feb 22, 2017 4:01 am
Forum: Support and Development
Topic: Rotating keys in a table
Replies: 5
Views: 3685

Rotating keys in a table

Is there a function to rotate keys in Lua? Something like this: -- table.rotate(t,value) value accepting positive and negative numbers table = {1, 2 ,3 ,4 ,5} table.rotate(table,1) -- {2, 3, 4, 5, 1} table2 = {1, 2 ,3 ,4 ,5} table.rotate(table2,-1) -- {5, 1, 2, 3, 4} I was so used with it in Ruby , ...
by megalukes
Thu Dec 08, 2016 7:33 pm
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1791
Views: 1503059

Re: What's everyone working on? (tigsource inspired)

Draw to a canvas at the resolution you need and scale that up. I must confess I hesitated to use canvases so far. Each dialogue window would have to need a canvas if I'd do that (I don't think I'd have more than 5 windows on screen at the same time). Is there any chance I get slowdowns because of t...
by megalukes
Thu Dec 08, 2016 2:29 am
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1791
Views: 1503059

Re: What's everyone working on? (tigsource inspired)

I decided to revive an old project of mine. I was developing it in RPG Maker but after a while its limitations made me stop. It's been tough work in Love. I'm not using an editor (apart from Tiled for maps), so everything is way harder than before. I almost finished the message system so I made a gi...
by megalukes
Tue Dec 06, 2016 4:06 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

how do i make something in bump.lua non-collidable without removing it from the world? (or setting its width and height to 1) Define a filter for your collision. When retuning 'cross', it'll ignore it so you can handle it differently. local playerFilter = function(item, other) if other.isCoin then ...
by megalukes
Mon Dec 05, 2016 6:20 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

pgimeno wrote:See [wiki]love.graphics.setScissor[/wiki].
Thank you so much!
by megalukes
Mon Dec 05, 2016 5:17 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

Is there a way to clip text? I wanted to print text inside a quad for a scrolling effect, but I didn't find out how.
by megalukes
Fri Dec 02, 2016 7:29 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

Thanks, guys. This was kind of hard to understand since the rectangle's draw function doesn't have sx/y and ox/y arguments. I did a bunch of pushes and pops to control it better. quad = {} quad.x = 0 quad.y = 0 quad.sx = 1 quad.sy = 1 quad.r = 0 quad.w = 256 quad.h = 128 quad.ox = quad.w/2 quad.oy =...
by megalukes
Fri Dec 02, 2016 1:57 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

Beelz wrote:Apply your offset when drawing:

Code: Select all

love.graphics.rectangle("fill", quad.x-quad.ox, quad.y-quad.oy, quad.w, quad.h)
It's behaving weirdly though. I'm trying to find a solution for that here.
by megalukes
Fri Dec 02, 2016 12:01 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 411506

Re: "Questions that don't deserve their own thread" thread

What am I doing wrong? I want to scale a rectangle but I need its position to be always on center of the mouse pointer. quad = {} quad.x = 0 quad.y = 0 quad.sx = 1 quad.sy = 1 quad.r = 0 quad.w = 256 quad.h = 128 quad.ox = quad.w/2 quad.oy = quad.h/2 function love.update(dt) quad.x, quad.y = love.mo...
by megalukes
Fri Dec 02, 2016 12:06 am
Forum: Support and Development
Topic: Problem with Tasty Text's setSub
Replies: 3
Views: 3295

Problem with Tasty Text's setSub

I'm using Tasty Text to create dialog windows, but I'm having some trouble with the :setSub function. Have a look:
text issue.gif
text issue.gif (61.86 KiB) Viewed 3295 times
Everytime setSub goes to a new line, it draws its firt character twice (it doesn't happen in the last line for some reason). How do I solve this?