Jump to content

Search the Community

Showing results for tags 'text2d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 12 results

  1. Hi, I have a Text2D in a Rectangle2D, I change the text every 200ms but it does not refresh on the screen. Although when looking at the text property it changes properly. The text refreshes only if I set its levelVisible property on and off at each tic. I do not have this problem in the playground so I am not sure what is going on. state.tic = function () { const text = newText() // this works state.tooltipPause.text.text = text // setting the parent rectangle2d levelVisible // is the only way i have found to refresh the view
  2. Hi guys, I'm creating an UI for my babylon game via the Canvas2D, precisely the ScreenSpaceCanvas2D. Now I want to know if it's possible to update the text dynamically without recreating/overwriting the text2d child every time the score variable (which is used for displaying) is updated. Playground link for simplified case: http://www.babylonjs-playground.com/#2AVSFH#271 Thanks in advance!
  3. Hi, I'm trying to show a text label when I hover the mouse over a mesh (sphere). It needs to show up at the exact position of the sphere. Something like: OnPointerOverTrigger -> show text label OnPointerOutTrigger -> hide text label Not sure if I have to use actions... trigger... pick()...text2d. Couldn't figure it out. Is there a way to do it using HTML? Playground: http://www.babylonjs-playground.com/#NH8WYW Can anyone help me? Thanks
  4. 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
  5. 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
  6. Th following code was working in previous release (preview), rendering text on two lines: new Text2D("AAA\nBBB", settings) In current release (announced at 29 Jan) it doesn't work. It produces following exception: Uncaught TypeError: Cannot read property 'offset' of undefined at Text2DInstanceData.descriptor.set [as transformX] (http://localhost:63342/FirstSample/lib/babylon.canvas2d.js:8687:66) at Text2D.RenderablePrim2D.updateInstanceDataPart (http://localhost:63342/FirstSample/lib/babylon.canvas2d.js:9337:29) Without new line symbol: new Text2D("AAABBB", se
  7. Hi guys. Pinging @Nockawa for this one. I've been working him hard, lately, and I want to thank him for all the recent help. Today I am thinking about borders. Well, I HAVE been thinking about borders for quite some time, but those borders were international borders. Now, about Canvas2D primitives borders. Currently, I think there are only a few ways to make a Canvas2D based border. 1. Rectangle2D 2. Shape2D 3. Sprite2D. Each CAN be used to place a border around a Text2D, or just about anything else. But none of these bordering methods... automatically size-to-fit their cont
  8. Hi everyone I'm wondering why font size and font rendering is so different when comparing `DynamicTexture` and `Canvas2D` side by side. http://www.babylonjs-playground.com/#TFFCW Note: The huge but blurred text is `8px` while the small and crisp text is `32px` Dynamic texture returns the expected result while text rendered in canvas 2d seems to be way too big and blurry. Of course I could use a bigger font size (ie. 8 times the size needed) and then scale it down (`scale: 0.125`). But I'd like to understand what's going on… Any hint much appreciated! Anyone?
  9. Hey guys, just wondering if there's a way to set the transparency of a Text2D object (or a ScreenSpaceCanvas2D object) after it has been created? I'm assuming this functionality is somewhere but I can't find it or figure it out.
  10. royibernthal

    Text2D Bug

    So far I wasn't able to isolate the problem, so I'll try to give as many details as possible, even though most of them will probably be irrelevant to the bug. I have a ScreenSpaceCanvas2D instance that contains different instances of Group2D, some of those instance contain Text2D and some contain Sprite2D. For future reference "textField" would be a Text2D inside a Group2D inside a ScreenSpaceCanvas2D. Executed one after the other on click events at the same run: textField.text = "0"; -works as expected textField.text = "450"; -only displays "4" textField.t
  11. Is there a way for the Text2D primitive in Canvas2D to load Google Web Fonts? Or any custom font for that matter. It seems to use it only when the font is loaded on your local system. It doesn't use the font that the page loads from Google. Thanks!
  12. Is there a way to create text in text2d which has an outline, something like the image below? I'm going to go ahead and assume the answer to this is no, in which case, could this possibly be added in the future? It's nothing really all that important but it fits with the style of what I'm trying to make. The css solution to this is to use shadows. text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; Whatever the answer may be, thanks for taking the time!
  • Create New...