Jump to content


  • Content Count

  • Joined

  • Last visited

About TMTH

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Just a few thoughts, unstructured, stream of consciousness style. 1. Working with primitives we have two very different areas – primitive transformations (all that matrix things) and primitive alignment (something to make developer’s life easier). On can leave without the latter, doing everything by hands, without any help from the framework, but not without the former. So, that transformation layer has to be stable and has to have very predictable behavior. Now, the framework has some problems with that predictable behavior. 1.1. Origin is not origin. Origin is the point
  2. I'm not sure that I understand your question. There are two kinds of positions - position of glyph in the source texture, and position of glyph in the target texture (or on screen). rectangle(x, y, x + width, y + height ) gives you rectangle in source texture, in absolute, not normalized coordinates - the glyph, that has to be rendered. On the other side, xoffset, yoffset, xadvance gives you directions on how to render that glyph in target. You need all of them - xoffset and yoffset to render current glyph, and xadvance to find base position for the next glyph. They've got a pictur
  3. @Nockawa, Yes, width is the width of the character, but you can't discard xadv because it defines position increment when moving from one character to the another. And yes, that increment is not equal to character width. Example is here https://www.gamedev.net/topic/330742-quick-tutorial-variable-width-bitmap-fonts/
  4. "Origin property of primitive" is solved. About width and height. You are right, you can set it on sprite instance. As I said, that is not a bug, that is a question of usability.
  5. @Temechon, thanks. That solution will solve my problem.
  6. @Nockawa, that's not actually a bug. BitmapFontTexture is working properly. That was a question about using regular FontTexture "when using custom font, embedded into css/html ". So, when I have: @font-face { font-family: AAA } in my css, and refer to that AAA font in Text2D settings, font is not always loaded to the client when Text2D starts to render. So, text is rendered using some default browser substitute. The same thing can happen with ordinal html, but after loading the font browser usually re-renders text. And the question was - can we do something with it, or the onl
  7. Character width calculation is wrong for not mono-spaced fonts. Error is here (BMFontLoaderTxt._buildCharInfo): if (xadv) { width = xadv; } Character width is not always equal to xadv. Try to export Arial from BMFont and look to number characters (48-57) When rendering, wrong part of texture is taken for character. @Nockawa
  8. Sprite2D expects that underlying texture may not be loaded on sprite2d creation. It waits for texture to load, and everything is working fine. But the same problem can arise with Text2D, when using custom font, embedded into css/html. When Text2D object is created, it tries to create font texture, using supplied font parameter. But that font has to be loaded, and that is the process that takes time. So there is no font to use. In Firefox it leads to rendering Text2D objects without any text at all, soft page refresh fixes it. In Chrome one of the system fonts is used instead of
  9. That problem is more urgent then the first one. Because you can emulate CACHESTRATEGY_ALLGROUPS using CACHESTRATEGY_TOPLEVELGROUPS, just making fake "child" for group and manually setting it's position in response to "parent" actualPosition property changed. Thus you will have cached group, that behaves just like normal group. But when your turn on CACHESTRATEGY_TOPLEVELGROUPS using designSize, all your layout will be visually broken. And I can see no workaround for that problem.
  10. 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 rea
  11. There is a question on using Sprite2D primitive when sprite size is larger then texture size. The common usage scenario is filling some area with "pattern" texture. Logically, that behaviour can be achieved by setting wrapU and wrapV properties of underlying texture to Texture.WRAP_ADDRESSMODE. But Sprite2D doesn't support that usage scenario. In Sprite2D constructor: super(settings); this.texture = texture; this.texture.wrapU = Texture.CLAMP_ADDRESSMODE; this.texture.wrapV = Texture.CLAMP_ADDRESSMODE; so, Sprite2D overrides texture settings. That snippet will use CLAMP_ADDRE
  12. Here is PG: http://babylonjs-playground.com/#Y5PEE#3 case 1. I have primitive with default fill that is not null. When I try to change that fill (on click), everything is OK. case2. I have primitive with default fill that is null. When I try to change that fill (on click): case 2.1 if I use "BABYLON.Canvas2D.GetBrushFromString" to produce IBrush object nothing happens case 2.2 if I use "new BABYLON.SolidColorBrush2D" to produce IBrush object nothing happens, but second click will change the color. Is it a bug or designed feature? (@Nockawa)
  13. There are two questions about sprite2d behaviour, again I don't know whether it's bug or intended properties (fun club of @Nockawa keeps working) 1. Origin property of primitive. (That can be a bug) From documentation: Origin: define the origin of the primitive, default being 0.5,0.5, which is the center of the primitive, 0.0,0.0 would be the bottom/left corner of the primitive. The origin play a role in the rotation/scaling of the primitive but not in its positioning. Here is PG with exploration of that "not in its positioning" thing in
  14. And one more bug (or feature that I don't understand) for @Nockawa http://babylonjs-playground.com/#NRZYA I'm using designSize on canvas. When I change cachingStrategy on canvas, I see change in absolute position on top level primitive. Is it intended behaviour?
  15. Yes, I've read all the docs, and explored large part of canvas2d source code. I could suggest one improvement of documentation - strict marking of components that work now, and component that are under development. So, that one reading, for example, documentation on Group2D could see, that not all cache modes are supported right now
  • Create New...