Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Performance issue and groups.


turjuque
 Share

Recommended Posts

Hi there!

 

I'm porting AncientBeast to Phaser but i'm facing some problems.

 

First of all, it seems that the rescale function of Phaser do not scale the rendered area as it remains at the start resolution (it's scaled after rendering). Is it right? I think it does have an impact on performance.

 

Secondly it seems impossible to have nested groups with transforms. Speaking of groups, is it possible to group shapes like sprites?

 

Finally my main performance issue : I only have a background sprite with 139 hexagons sprites on top and 2 creatures and it's already laggy. Is it because the renderer is set to 1920*1080?

 

I was considering doing the hexagons with shapes but they seem to be less flexible.

 

Any idea on how to proceed?

Link to comment
Share on other sites

The size given to the game constructor is the size the canvas will remain at, scaling only effects how much this is stretched. You could work out before constructing the game the available viewport size and give those values over, but it's up to you to handle how the graphics are positioned so that they'll work no matter what the game size is.

 

You can definitely nest groups with transforms, but the transform will cascade to its children. For example if group 1 has angle set to 10, then you add group 2 which already has an angle of 10, it will inherit the parent and appear at an angle of 20. Not sure what you mean by your "group shapes" thing, sorry.

 

1920x1080 is asking quite a lot, it should be fine on desktop in WebGL but that will really struggle once you take it to mobile. You definitely don't want to be using ANY primitive graphics in this quantity / resolution, you should use images for it all (or a shape rendered to a canvas), but definitely not drawn at run-time.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...