Make layer invisible in ATL? [SOLVED]

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
herksaw
Prole
Posts: 3
Joined: Fri Jul 18, 2014 11:39 am

Make layer invisible in ATL? [SOLVED]

Post by herksaw »

Let's say I have two layer, which named "background" and "foreground" respectively. Is it possible to make the foreground layer "invisible" in runtime?
Last edited by herksaw on Sun Jul 20, 2014 4:45 am, edited 1 time in total.
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: Make layer invisible in ATL?

Post by undef »

Set the alpha to 0, with love.graphics.setColor
twitter | steam | indieDB

Check out quadrant on Steam!
dan369
Prole
Posts: 44
Joined: Tue Apr 15, 2014 10:53 pm

Re: Make layer invisible in ATL?

Post by dan369 »

Each tile-layer has an opacity, just change it's value to 0 and the ATL [yourMap]:draw() function does the rest!
Could also just set the tile-layer not to be visible (you have 1 less render call that way).

Example:

Code: Select all

if (key == "f1") then map("Collision Layer").visible = not map("Collision Layer").visible; end
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 3 guests