Jump to content

Photo

Layers


  • Please log in to reply
7 replies to this topic

#1 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 08 August 2018 - 03:11 AM

Is there any way to show/hide layers with scripting, including in experimental builds?



#2 TheRock

TheRock

    Go glitches

  • Members

Posted 08 August 2018 - 08:11 AM

Go to Screen->Screen Data->S.Data 1-> then under Lens Effect you can hide a layer and reveal a layer with the lens.


Edited by TheRock, 08 August 2018 - 08:13 AM.


#3 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 08 August 2018 - 05:01 PM

But then firstly, I would need to set that every screen, secondly, it would require use of the lens. I'm looking for a way to show/hide a layer using purely scripting. (I want it so that whenever the player presses Ex4 it toggles the visibility of Layer 4)



#4 grayswandir

grayswandir

    semi-genius

  • ZC Developers

Posted 12 August 2018 - 06:25 PM

It's been a while and I don't remember much, but you can probably adapt my script over here to do it: https://www.purezc.n...=scripts&id=227


  • Emily likes this

#5 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 14 August 2018 - 12:17 AM

It's been a while and I don't remember much, but you can probably adapt my script over here to do it: https://www.purezc.n...=scripts&id=227

I was actually able to modify that PERFECTLY in like 2 minutes. (Basically I set under to always be true, and made OVERHEAD_INVISIBLE a var instead of a constant and I toggle that with Ex4)


  • ShadowTiger likes this

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 14 August 2018 - 10:15 PM



Is there any way to show/hide layers with scripting, including in experimental builds?

 

In 2.54, yes. Screen->LayerScreen[], Screen->LayerMap[]; and *mapdata->LayerScreen[] and ->LayerMap[] for remote screens.

 

in fact, I did precisely that in my Arkanoid quest. ;)

void clear_combos()
    {
        templayer[0] = Screen->LayerOpacity[0];
        templayer[1] = Screen->LayerOpacity[1];
        templayer[2] = Screen->LayerMap[0];
        templayer[3] = Screen->LayerMap[1];
        Screen->LayerOpacity[0] = 0;
        Screen->LayerOpacity[1] = 0;
        Screen->LayerMap[0] = 0;
        Screen->LayerMap[1] = 0;
    }

i call that, when setting up brick enemies, from combo data.

 

Here's the entire script.

 

You can also set layers translucent, or opaque using Screen->LayerOpacity[] and *mapdata->LayerOpacity[].

 

I might look into a way to make layers entirely invisible, with LayerOpacity[] in the future. At present, you can only set them to translucent, or opaque.


  • ShadowTiger and Emily like this

#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 15 August 2018 - 01:00 AM

Which 2.54 version is that in? It isn't in the one I have at the moment. (though not particularly necessary given that I now have a perfectly functional script for it without that, but that still looks nice)



#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 August 2018 - 03:40 AM

Which 2.54 version is that in? It isn't in the one I have at the moment. (though not particularly necessary given that I now have a perfectly functional script for it without that, but that still looks nice)

 

I added it in 2.54, Alpha 16. You should keep with the latest build at all times though. Alpha 31 is the current one.


  • Emily likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users