Jump to content

PrimitiveAlignment mechanics is broken when using canvas design size


TMTH
 Share

Recommended Posts

Here is PG. http://babylonjs-playground.com/#QTNKM#1

When using designSize on canvas alignment properties are unusable.

There are two different use cases:

1. I manually position primitive on some point. I expect it's position to be uniformly scaled from design size to real rendering size. That one is working.

2. I do not position primitive, but I set primitive alignment. Let it be marginHAlignment = BABYLON.PrimitiveAlignment.AlignRight. In that case I expect this primitive to be stuck on the right side of the rendered canvas. That case is not working.

So, building real UI  I have a problem. I can build UI panels using absolute positioning, and it will be OK, but how can I position those panels? Suppose I want one panel to be on left side of the canvas, and one on the right side - not so complex high level layout. Left one will be positioned fine, but with positioning right one I will have a problem. Big one.

@Nockawa, is there any work around for this?

 

Link to comment
Share on other sites

  • 2 weeks later...

Maybe this hasn't made it into the preview or the PG, or possibly I am using designSize wrong. But are these working right @Nockawa

http://babylonjs-playground.com/#2GDFI4 using position

http://babylonjs-playground.com/#2GDFI4#1 using marginalignment

Also I put a backgroundFill in, as I thought the idea of designSize was to grow/scale to fit the canvas.

Sorry if I should have created another thread, but this seemed on topic.

 

Link to comment
Share on other sites

@unintellisense well, yes, I had to rollback part of the code that were making this working (because unfortunately this code broke the scale propagation through primitive tree), as I said in other thread, that's the last thing I have to dev/check: alignment working correctly in all cases. I'm going to start that today, be a little more patient.

I hate that because C2D has been unstable lately, trying to make all features people asked working at the same time was quite a challenge...But the worst is definitely behind...

Link to comment
Share on other sites

You can find it here: https://github.com/nockawa/Babylon.js/tree/master/dist/preview release/canvas2D

But I'm about to make a big release with many changes/fix (good ones), I have one little thing to fix then I commit. So wait few hours or take immediately the actual file.

Make sure to watch this thread (http://www.html5gamedevs.com/topic/22552-canvas2d-main-post/), I post a message for every update of C2D

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

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