AJAX content

Get help using Construct 2

Post » Thu Apr 18, 2013 11:09 am

Hi all!
How can I retrieve images, videos etc. from AJAX object?
I can retrieve it simply, I know, but how can I insert, maybe, an image loaded with AJAX, in my game?
B
4
Posts: 5
Reputation: 443

Post » Thu Apr 18, 2013 11:35 am

You make an ajax Request which contains the url of the image and than you say Sprite Load Image from Url ("Ajax.X").

Do you know the Hash Plugin ? It will help you much to work with Ajax data ;)


For videos I cant help you, I never made something with that.. But I think it would be possible with an iFrame.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Thu Apr 18, 2013 4:07 pm

So can't I have, maybe, an HTML page(With images and texts) loaded directly into a Construct 2 Object?
B
4
Posts: 5
Reputation: 443

Post » Thu Apr 18, 2013 4:23 pm

Sure you can.

The Load Image from Url just loads an Image from an Url and set a given Sprite to this.

This means you make a mockup from your page with sprites(just filled with the color of your choice) and than after the Ajax Request you grant them the right images.

Loading Screen. With this Tutorial you can make your own Loading Layout, so you can load the images before the page gets shown. But dont forget the Sprites you want to replace need to be on this Loading Layout!

Manual for load Image from Url
B
15
S
6
G
6
Posts: 512
Reputation: 5,550


Return to How do I....?

Who is online

Users browsing this forum: Lof, Yahoo [Bot], YoHoho and 24 guests