Comments (6)
Hi neeraj,
I can infer little from your description. I think you're not initializing properly the director element. Are you doing it like this :
director= new CAAT.Director().initialize(700,500,document.getElementById('game')).setClear( false );
the "game" Dom element must a div element.
About performance on mobile, you could try executing on canvas with calling the following code:
director.setClear( CAAT.Director.CLEAR_DIRTY_RECTS )
this code instrument to redraw only on-screen affected areas and depending on your game, it could speed things up a lot.
Let me know how it goes for you.
Regards,
-ibon
from caat.
Hi IBon,
Thanks for your quick response. I am using the standard template.js
supplied with CAAT to initialize the director. I am using the template with
splash file. The director in being initialized in that file with the
following code
var director = new CAAT.Director().
initialize(
width||800,
height||600,
isCanvas?canvascontainer:undefined).
setClear(false) // set director to NOT clearing the background
;
My canvascontainer is a div in HTML.
The exact issue I am facing on mobile devices is that when the orientation
of the device is changed the click areas are changes e.g. in portrait mode
I can see my buttons properly when I rotate the device and make the
orientation landscape the button appears in the correct place but the click
area is misplaced.
Thanks,
Neeraj.
On Fri, Feb 24, 2012 at 6:07 PM, hyperandroid <
[email protected]
wrote:
Hi neeraj,
I can infer little from your description. I think you're not initializing
properly the director element. Are you doing it like this :director= new
CAAT.Director().initialize(700,500,document.getElementById('game')).setClear(
false );
the "game" Dom element must a div element.About performance on mobile, you could try executing on canvas with
calling the following code:
director.setClear( CAAT.Director.CLEAR_DIRTY_RECTS )
this code instrument to redraw only on-screen affected areas and depending
on your game, it could speed things up a lot.Let me know how it goes for you.
Regards,-ibon
Reply to this email directly or view it on GitHub:
#44 (comment)
from caat.
Thanks neeraj.
Will make a use case for this issue.
You could enable resize events for directors with:
director.enableResizeEvents(CAAT.Director.prototype.RESIZE_PROPORTIONAL);
or any of the other RESIZE_XXX flags.
This way you could allow the director to conform appropriately to the new
screen size. The drawback, is that it will try to occupy the whole screen
area scaling up/down as needed.
Let me know if this works for you.
Regards,
-ibon
El 24 de febrero de 2012 14:08, neeraj-anka <
[email protected]
escribi:
Hi IBon,
Thanks for your quick response. I am using the standard template.js
supplied with CAAT to initialize the director. I am using the template with
splash file. The director in being initialized in that file with the
following code
var director = new CAAT.Director().
initialize(
width||800,
height||600,
isCanvas?canvascontainer:undefined).
setClear(false) // set director to NOT clearing the background
;My canvascontainer is a div in HTML.
The exact issue I am facing on mobile devices is that when the orientation
of the device is changed the click areas are changes e.g. in portrait mode
I can see my buttons properly when I rotate the device and make the
orientation landscape the button appears in the correct place but the click
area is misplaced.Thanks,
Neeraj.On Fri, Feb 24, 2012 at 6:07 PM, hyperandroid <
[email protected]wrote:
Hi neeraj,
I can infer little from your description. I think you're not initializing
properly the director element. Are you doing it like this :director= new
CAAT.Director().initialize(700,500,document.getElementById('game')).setClear(
false );
the "game" Dom element must a div element.About performance on mobile, you could try executing on canvas with
calling the following code:
director.setClear( CAAT.Director.CLEAR_DIRTY_RECTS )
this code instrument to redraw only on-screen affected areas and
depending
on your game, it could speed things up a lot.Let me know how it goes for you.
Regards,-ibon
Reply to this email directly or view it on GitHub:
#44 (comment)
Reply to this email directly or view it on GitHub:
#44 (comment)
from caat.
Have taken a look at the template code, and have modified them to run with CSS as well.
Will upload a new caat version today.
Sorry for the inconvenience.
from caat.
Pushed new templates and some fixes.
Try them and let me know how it goes.
Regards,
-ibon
from caat.
Hey thanks a lot Ibon. I will try with the new code and let you know.
Neeraj.
On Tue, Feb 28, 2012 at 3:46 AM, hyperandroid <
[email protected]
wrote:
Pushed new templates and some fixes.
Try them and let me know how it goes.
Regards,-ibon
Reply to this email directly or view it on GitHub:
#44 (comment)
from caat.
Related Issues (20)
- audio loop issue in firefox
- Exact pixel hit detection HOT 2
- Rendering wrong when use director.enableResizeEvents(CAAT.Director.RESIZE_PROPORTIONAL) HOT 2
- Actor SetAsButton Touch not working on CocoonJS 1.3 ? HOT 3
- Actors with SpriteImage can't rotate or scale correctly with anchors HOT 6
- Is CAAT running well in mobile
- Wrong license creation produced invalid js files within build folder. HOT 1
- Bug in actor.js /setRotationAnchor()
- Inconsistencies when hiding actor after a end of a behavior
- Cannot Remove Directors
- CSS renderer seems to be broken
- Small bug in __mouseDownHandler in Director.js
- Stop sprite image animation HOT 4
- collision image HOT 5
- uncaught exception: adding to a container an element with parent. HOT 3
- Demo not working HOT 1
- disable ctrl rotation in actor with enableDrag true
- How to add a method on complete event of RotateBehavior HOT 2
- Need to allow user to enter his name for score submission
- Path management example starting point
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caat.