Also, this.pgimeno wrote:You access the components like: boxes[1].colour[1] through boxes[n].colour[3]
Picking a value from a table
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Picking a value from a table
Re: Picking a value from a table
I don't understand what's what you want to figure out. boxes.colour[1] is the red component from 0 to 255, boxes.colour[2] is the green component, and boxes.colour[3] is the blue component. You can pass them to love.graphics.setColor if that's your question. Using unpack() would be more compact and probably more efficient, but since you're having trouble with this, better try component by component for now.Oblivion_123 wrote:Ok, but that still doesn't answer my question, is there a way that I can use this info to figure out the colour of box. Do you know any way?
Re: Picking a value from a table
pgimeno wrote:I don't understand what's what you want to figure out. boxes.colour[1] is the red component from 0 to 255, boxes.colour[2] is the green component, and boxes.colour[3] is the blue component. You can pass them to love.graphics.setColor if that's your question. Using unpack() would be more compact and probably more efficient, but since you're having trouble with this, better try component by component for now.Oblivion_123 wrote:Ok, but that still doesn't answer my question, is there a way that I can use this info to figure out the colour of box. Do you know any way?
Actually love.graphics.setColor accepts a table as the only Parameter too.
Who is online
Users browsing this forum: No registered users and 3 guests