Search found 14 matches

by MichaelShort
Thu Apr 06, 2017 12:53 pm
Forum: Support and Development
Topic: "Attempt to index global x a (a nil value)" error
Replies: 7
Views: 5711

Re: "Attempt to index global x a (a nil value)" error

Davisdude's solution worked, thanks for the help.
by MichaelShort
Wed Apr 05, 2017 12:58 pm
Forum: Support and Development
Topic: "Attempt to index global x a (a nil value)" error
Replies: 7
Views: 5711

Re: "Attempt to index global x a (a nil value)" error

@DireMitten, the output prints "1 Button1" and then it errors again with "attempt to index global x (a nil value)."

@yetneverdone, that solution also outputs "attempt to index global x (a nil value)."
by MichaelShort
Tue Apr 04, 2017 1:30 pm
Forum: Support and Development
Topic: "Attempt to index global x a (a nil value)" error
Replies: 7
Views: 5711

"Attempt to index global x a (a nil value)" error

What I'm trying to do is make the variable x for the textbutton, so that I can continue positioning and sizing x after I've created it. I'm using this https://love2d.org/wiki/Easy_GUI_System for the GUI. One of the solutions I've tried using: for i=1, 3 do x = "button"..i TextButton:new(x)...
by MichaelShort
Tue Oct 20, 2015 3:06 pm
Forum: Support and Development
Topic: Concating strings and integers
Replies: 3
Views: 2464

Re: Concating strings and integers

Alright thank you guys.
by MichaelShort
Mon Oct 19, 2015 4:00 pm
Forum: Support and Development
Topic: Concating strings and integers
Replies: 3
Views: 2464

Concating strings and integers

So we're trying to concat log and i. When that happens we will be able to identify the log by its log number. ex log256 and log320 log..i doesn't concat it so any help would be appreciated. We're new to love2d. for i=64, 1856, 192 do love.graphics:reset() logs = { log..i = love.graphics.draw(logImg,...
by MichaelShort
Thu Oct 08, 2015 3:54 pm
Forum: Support and Development
Topic: Coloring Text Without Coloring Sprites
Replies: 2
Views: 1644

Re: Coloring Text Without Coloring Sprites

First, you shouldn't be creating the font in love.draw, which you are doing. Create a table named fonts and put fonts in it, or something like that; just use a variable named "font20" if you wish, but you should only create new fonts (or new anything) once. You can do what you're asking b...
by MichaelShort
Thu Oct 08, 2015 3:46 pm
Forum: Support and Development
Topic: Coloring Text Without Coloring Sprites
Replies: 2
Views: 1644

Coloring Text Without Coloring Sprites

So below we are coloring text. It also colors sprites with it though like are frog that we are making. How would we make it only color the text. Thanks in advance!

Code: Select all

love.graphics.setColor(0, 191, 255)
love.graphics.setFont(love.graphics.newFont(20))
love.graphics.print("hey", 100, 100)
by MichaelShort
Wed Sep 30, 2015 3:32 pm
Forum: Support and Development
Topic: Question about setColor
Replies: 2
Views: 1599

Re: Question about setColor

Ulydev wrote:

Code: Select all

love.graphics.setColor(255, 255, 255)
love.graphics.draw(myImage, x, y)
Setting the color to plain white will draw an image with its original colours.
Thank you so much. I was messing around with that and only tried (0,0,0) but now I noticed it made it black.
by MichaelShort
Wed Sep 30, 2015 3:25 pm
Forum: Support and Development
Topic: Question about setColor
Replies: 2
Views: 1599

Question about setColor

Me and a friend are trying to make a replica of frogger. The frogs eye color is red and the frog is green. This code makes the frog green because of the setColor below it. How can we make it not turn blue and keep the frog the original color of the png. Thanks in advance. function love.draw() if pla...
by MichaelShort
Tue Sep 29, 2015 8:10 pm
Forum: Support and Development
Topic: How can I make the player move a certain ammount of pixels?
Replies: 8
Views: 3984

Re: How can I make the player move a certain ammount of pixe

Okay, it looks like you want to create a Frogger clone ? If so you don't have to use love.update to update the movement (if you dont want smooth movement). Instead try to use the keypressed callback. And then to move the frog just update its x / y position by adding a static value (the jumpDistance...