Image Cycle

  • Hello, tyyylerxxx you could use the Fullscreen Template and modify it a bit (no scripting needed) !

    It's similar to what Kelsey wanted to do, but as i understand with images and not face masks.

    Also check this old post :

    https://support.lensstudio.snapchat.com/hc/en-us/community/posts/360012150506-Tap-to-switch-toggle-between-two-face-masks

    Best,

    Nick

    1
    Comment actions Permalink
  • Hey Tyler, 

    If you are just trying to enable/disable a series of images so you cannot see them, take a look at the Fullscreen Template. All you would need to do is plug your images into each Template Slate! That script is built for much more than just showing and hiding images on tap, you can do a lot of things like play/stop music and animations as well! 

    If you specifically need to change alpha to 0, you would need to change the baseColor property of your image. That property is represented in a vec4 format (R,G,B,A). That code would look something like this:

    // @input Component.Image image

    script.image.mainPass.baseColor = new vec4(1, 1, 1, 0);

    Let me know if you have any questions!

    Ben

     

    0
    Comment actions Permalink
  • hi tyyylerxxx

    there is many ways to do that
    to edit an alpha of image you need to code it and also need a function changes between the two images ...
    all you need is a simple way

    check the behavior script

    simply use a clicked images by adding the touch component

    1 : click on the first image shown ( the last image added )
    2 : in the inspector panel click add component and select the Touch Component
    3 : in the Mash Visual select the same image you clicked before
     ( repeat for the second image )

    now all you need is to create a project and use  the behavior script 

    1 : create an empty new project . click on it  and drag the behavior script to the inspector panel 
    2 : select Touch Event in the Trigger
    3 : select the clicked image in the Touch Target
    4 : in the Response Type select SET ENABLED
    5 : you will notice a new Target select in it one of the two images 
    6 : in Action select Disable

    duplicate the behavior script and repeat the same steps but change in 
    5 : the target must be the second image
    6 : in Action must  select enabled

    now so far all you got is when you click on the one image one disabled and other enabled
    .you can repeat all of this for the second image
    when the second image clicked the second one disabled and the first one enabled

    if you have any questions let us know

    have fun.

    0
    Comment actions Permalink
Have a comment?

Please sign in to leave a comment.

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?

Version

Graphics

Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:

Name:

Email:

What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!