trying to import the libs: splidejs and swipperjs, but without success!

0 favourites
  • 1 posts
From the Asset Store
25 high-quality orchestral fanfares divided in: Success, game overs, alerts, level ups, stingers
  • Hello everyone, I'm trying to embed https://splidejs.com/ or https://swiperjs.com/ , but I have a problem regarding the initialization of both...

    I've already tried importing the js/css of both within:

    async function OnBeforeProjectStart(runtime)
    {
    	// Code to run just before 'On start of layout' on
    	// the first layout. Loading has finished and initial
    	// instances are created and available to use here.
    	
    	
    	loadCSS("https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/css/splide.min.css");
    
    	loadJS("https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.4/dist/js/splide.min.js");
    	
    	runtime.addEventListener("tick", () => Tick(runtime));
    
    	
    }
    
    function Tick(runtime)
    {
    	// Code to run every tick
    }
    
    function loadCSS(url) {
     var link = document.createElement("link");
     link.rel = "stylesheet";
     link.href = url;
     link.crossOrigin = "anonymous";
     document.head.appendChild(link);
    }
    
    function loadJS(url) {
     var script = document.createElement("script");
     script.src = url;
     script.crossOrigin = "anonymous";
     document.body.appendChild(script);
    }
    

    I have already tried adding it to the event sheet both when starting the layout and when completing the layout loading, neither of them work.

    Is there any way to import this type of library into construct 3?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)