using google apis for jquery and screen size change with 1.1.1 engine
Shri

Gio,

 

I am trying to put my games onto a website.

I thought that a good way to load the jQuery stuff would be to use the google apis.

However, when I try to use

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

As recommended on the google site, it doesn't work.

But what you put in your index html file

<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>

does work ?

I'm curious as to why one works and the other doesn't ?

 

Also, I have noticed that running with the wade.1.1..1.js engine versus running with the wade.1.1.js engine changes the screen size of the game on the web page.

The game is one of the first I made, and it uses the technique from your first game sample to set the screen size.

wade.setMinScreenSize(708, 398);
wade.setMaxScreenSize(708, 398);

 

In 1.1, the game scales to the center of the screen and resizes correctly,

The 1.1.1 version,always runs in the top left corner and some of the graphics can appear off the game screen ?

 

The css and html files look the same.

 

Should I be setting up the game screen or catching a resize event in 1.1.1 ?

 

thanks,

Shri

All 2 Comments
Gio

Hi

 

Can you please try the latest version 1.1.2 and see if your screen size problem has been resolved? (It should have been)

 

I haven't tried the google ajax API CDN yet, but it is my understanding that it load those javascript files asynchronously. When you load them through a normal url, scripts in the html page are executed in order, so wade is executed after jquery has been loaded and executed, and the document.ready event doesn't fire until all the scripts have been loaded.

 

With google's ajax CDN, I think that is no longer true, and you have to set up a specific system of callbacks if you want to preserve the execution order of your scripts.

 

Using a CDN is generally a good idea, but I don't think that particular one is the best you can use for a WADE app.

Shri

Gio,

 

I didn't know there was a 1.1.2 release. Not sure how I missed that ?

I will download it and try it and let you know.

 

Just tried it with the 1.1.2 engine, and the problem seems to have fixed.

Looking at the change log, it seems it may have been related to one of these.

  • BugFix (B87): canvases that are created after the game is started don't have the correct size
  • BugFix (B88): when the window mode is set to 'none', the position of the game canvases isn't always consistent

 

 

thanks, and enjoy the rest of your weekend

Post a reply
Add Attachment
Submit Reply
Login to Reply