Giter Club home page Giter Club logo

Comments (6)

hyperandroid avatar hyperandroid commented on August 24, 2024

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.

neeraj-anka avatar neeraj-anka commented on August 24, 2024

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.

hyperandroid avatar hyperandroid commented on August 24, 2024

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.

hyperandroid avatar hyperandroid commented on August 24, 2024

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.

hyperandroid avatar hyperandroid commented on August 24, 2024

Pushed new templates and some fixes.
Try them and let me know how it goes.
Regards,

-ibon

from caat.

neeraj-anka avatar neeraj-anka commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.