How do I load an image from url?

  • In the event sheet I use

    SYSTEM On start of layout

    SPRITE load image from url

    The image is hosted on a server with a domain I own and it still does not show up when testing the project.

    How do I load an image from url?

    How do I check the Construct 3 console?

    Please and Thanks

    Tagged:

  • HELLO,

    That way, we can't help you, if it's on a server, you're going to need the "browser" object, if I don't say anything.

    Show us an example.

  • Attached is a screenshot of what Ive got going currently with the project. Ive had to enable CORS with htaccess and Ive managed to get the image to load from URL 1 time then it stops working. If I clear my browser history it works again. One time it works then stops until the history is cleared. Is there something I'm missing?

  • Just to update I removed the loading of the first image that was loading from and image hosting site which worked with load image from url and now I can load images from url from my host without clearing browser history each time!

  • Well everything works fine with my safari browser on Mac but when I test the application on a mobile browser (Edge and FireFox) it fails to load the images from Url. Can someone help me determine why this won't work?

  • Hi, sorry I can't help you.

  • here is a tutorial load image from url

    you need a hosting server (webhosting for websites or any server that allows you to access content online) that allows you to fetch the data from there, otherwise won't work.

    1 - You must use a hosting server with "Access-Control-Allow-Origin:" permission (to use images on other sites). Otherwise the image will not load (show).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you and yes I needed a domain and web hosting and an ssl certificate. I also had to setup CORS via php and a .htaccess file via the Cpanel of the web hosting. Now if I could just get the mobile browser to hide when Im testing my project.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)