turjuque

Performance issue and groups.

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.