jelawrence's Forum Posts

  • 1 posts
  • I have uploaded png and css files in the Files section of the Project bar but I can't seem to locate where these files appear while previewing the project.

    When the game is exported, the files are saved in the root directory and can be accessed using "filename.png" (for example, background-image: url("filename.png") in a css file.

    However, in the web browser while previewing the game, "filename.png" does not work, nor does "files/filename.png" or "Files/filename.png".

    For loading CSS files from the files, I am running the script:

    link = document.createElement("link");
    link.type = "text/css";
    link.rel = "stylesheet";
    link.href = "style.css";
    document.head.appendChild(link);
    

    This as well only works when exported since style.css can not be located in the preview.

    How can I access imported files when previewing the project in Construct 3?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1 posts