[Solved] Need Help Loading Images

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
.InsertNameHere
Prole
Posts: 9
Joined: Mon May 18, 2015 6:53 am

[Solved] Need Help Loading Images

Post by .InsertNameHere »

Hello, I am quite new to both Love and Lua, and I am trying to make a little game. In this game, I tried to load the scope image from the assets folder, and I want it so that the black parts of the scope cover up everything else in the image. This way, the player has to "hunt" around for their target. Right now, even though the .png is completely black, when loaded onto the game, the scope is partially see-through.

What am I doing wrong?

NOTE: I am using someone else's menu library (w/minor changes), and my Multiplayer is not done yet, I am still working on singleplayer.

Love file is attached.

Thanks in advance.
Attachments
game.love
Game
(13.89 KiB) Downloaded 125 times
Last edited by .InsertNameHere on Mon Jun 08, 2015 1:35 am, edited 1 time in total.
User avatar
Guard13007
Party member
Posts: 134
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Need Help Loading Images

Post by Guard13007 »

I didn't look for very long, but I guessed correctly from the start what your problem is. Somewhere the color of the game is being set with transparency. Take a look at love.graphics.setColor to see. The quick and dirty solution is as follows in your main.lua:

Image

BUT that is a quick fix which could lead to future bugs.

Like I said, I didn't look at everything in your game for very long, but I'm guessing you'll find a call to love.graphics.setColor somewhere in the menu.lua 's code. This call has a transparency value, and then everything after that point is drawn with some transparency.
.InsertNameHere
Prole
Posts: 9
Joined: Mon May 18, 2015 6:53 am

Re: Need Help Loading Images

Post by .InsertNameHere »

Thank You!
User avatar
Guard13007
Party member
Posts: 134
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Need Help Loading Images

Post by Guard13007 »

No problem. ^^ Just glad to actually be able to help someone instead of just asking for help.

(On an unrelated note, perhaps edit the thread title to include [Solved] so people know the issue has been resolved?)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Need Help Loading Images

Post by Robin »

BTW:

1. [wiki]love.draw[/wiki] doesn't take dt as an argument
2. You don't need to call love.graphics.clear() yourself. It's already called in the default [wiki]love.run[/wiki].
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest