I was looking into the examples and I would like to know if there is a Standard way to load different assets giving the resolution of the device that the game will be running into.
For instance I would like to create a light version of my game for low-end devices.
Thank you so much again Shun! It works as in the CPP version, very good.
Just my 2 cents, I think the MouseUP is not adjusting to the new resourceSize, so the click point in the onMouseUp are wrong by the scaleFactor (not that is hard to fix)
The code that I am using to get the MousePosition is this:
getOnPanelPos: function(loc){
var contentScale = cc.Director.getInstance().getContentScaleFactor();
var canvas = document.getElementById(“gameCanvas”);
var canvasW = canvas.getAttribute(“width”);
var canvasH = canvas.getAttribute(“height”);
var scale = canvasH/LS.WIN_SIZE.height;
var scaleReverse = 1/scale;
var paddingX = (canvasW - LS.WIN_SIZE.width*scale)/2;
var modifiedLoc = loc;
modifiedLoc.x = modifiedLoc.x*contentScale - paddingX;
As you can see after setting the contentScale as a multiplier I manage to make it work properly (this code also manage properly touchs in the black areas created in the frame of a game running).
For the LabelTTF error I have added the image of it. I am using the follow command to create it:
var lblPersonTitle = cc.LabelTTF.create(“Jabalaya Games”, “Helvética”, 28);