lihis

Members
  • Content count

    43
  • Joined

  • Last visited

  • Days Won

    1

lihis last won the day on October 31 2016

lihis had the most liked content!

About lihis

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Hey, with mesh it's possible to do: let check_for_reselect = function(item) { let pickInfo = scene.pick(scene.pointerX, scene.pointerY); if (!pickInfo.hit) { return false; } if (pickInfo.hit) { if (pickInfo.pickedMesh !== item) { return false; } else { return true; } } }; and run that in scene.onPointerObservable the next time a click happens to see if a mesh was repicked. I can't quite figure out how to check if a specific GUI element is going to be picked. Is that doable somehow? The use case would be something like: if GUI element is going to be reselected, do nothing otherwise run some deselect code. -> scene.pick allows you to "click without actually clicking" and see what's below mouse - i would like to do the same with GUI elements. Edit: Another question: is there a way to make onPointerDownObservable / holding mouse button down not block the processing of other observables like onPointerOutObservable? Example: https://playground.babylonjs.com/#SDJ5S8 If you start holding mousebutton down the hover does not stop even when moving outside the rectangle. In chrome the hover stops once you release mousebutton (and you are outside the rectangle), but in in Firefox you actually have to move the mouse after releasing the mouse button, otherwise it will keep the hover state forever.
  2. Hey @Wingnut Yeah, copying alignment works. But since i myself had not touched the alignment properties at all, alignment being the issue was completely out of my mind. It did not occur to me that using moveToVector3 might have changed alignment because i had not changed or used alignments at all. They were just their defaults. And moveToVector3 changed these defaults. I would have figured it calculates the proper left and top values using whatever alignment you happen to be using - not change the alignment and then do the calculation... Once you know what's up it's not a big thing, but in this case i think what's up is a bit hidden.
  3. Hey, just thought i'd drop this here! If you move GUI control with moveToVector3 and later try to place another GUI in the same spot using top and left values from the first one; it's not gonna go as hoped due to now different alignments. Example to be seen here: https://www.babylonjs-playground.com/#GGB8I0 Not a bug technically i suppose, but certainly sent me hunting for one. 🧐 I did not expect the alignment to change. No mention of this happening in the docs either (that my eyes could see). linkWithMesh appears to set alignments as well. Anyhoo, that's all.
  4. Helloo. Is this behaviour https://playground.babylonjs.com/#22T0N0 intended? If the child alpha is 1 --> it animates with the parent. if the child alpha is less than 1 --> it doesn't animate with parent. I was expecting the transparent middle button also become invisible as it's parents alpha reaches 0. Took me a while to figure out why some buttons weren't fading out along with their mama.
  5. lihis

    Problems with Playground URL

    Unfortunately Firefox is still giving me the default scene and not loading the requested playground. But it seems like the change might actually help some people since Myjestic got it working so that's good! I have no idea what the problem is in my case - might just be my PC having issues. I can continue to use Chrome to load playgrounds which is working fine.
  6. lihis

    Problems with Playground URL

    Hmm. I don't know if i'm having the same issue or not, but i think it's possible. I thought maybe it was just something wrong with my browser (and it might be), but i can't use Firefox to load playground urls because it always loads / redirects to the basic scene just like @Myjestic said. Works fine on Chrome however so i've just been using that for playground urls - even if it is a bit annoying as Firefox is my main browser and i have to copy paste links to the other window... Anyway, might be having same issue here so just reporting that in.
  7. How about setting the alpha property to 0? No idea if it works but maybe worth a shot if you haven't tried already.
  8. lihis

    Best way to create tooltip

    I know nothing about stack panels and even less about _best_ way to make tooltips, but i would maybe go about it something like this: http://playground.babylonjs.com/#6GWUV3 It's not auto-sizing though and maybe it sucks in some other ways as well but yeah.
  9. Ok so i happened to encounter a wild @Wingnut out and about and he actually had a great solution. No need to use buttons or anything crazy like that, instead there is a isPointerBlocker property that works just fine on GUI.Rectangle. http://playground.babylonjs.com/#84Q5FX#3 So big ups to our nutman for this tip!
  10. @JCPalmer Yeah that's a possibility if you don't want the mesh clickable while the GUI is there, but i think i do want it still clickable while the GUI is there, just not where the GUI is. @Deltakosh Hmm ok that's something i could do i suppose. Feels a bit strange to make a background element from GUI.Button instead of rectangle though. And i'd have to disable the animations from the button. But i guess that's decent hackaroo.
  11. Hello, I have a mesh that is clickable and i would like to prevent it being clicked if there is a GUI element in front of it. Playground: http://playground.babylonjs.com/#84Q5FX In this example i made the GUI clickable as well, but i would like the GUI to stop mesh from being clicked even if there wasn't click function assigned to it. Is this possible? I can almost do this with my own input handler, but it only works like 90% of the time. And it's a bit funky involving global cooldown on clicks. It also requires me assigning an empty click function to the GUI.
  12. Ah, yes, nice tips. I had indeed already done something very similar as it was annoying having that pesky browser context menu popping up! Thankfully it was a problem easily solved with the help of google and copy paste. Probably used right click for that...
  13. @Deltakosh Well, yeah, kind of i guess. But if you look at this playground: http://playground.babylonjs.com/#E2TSU0#2 I think the way i'm trying position the rect2 is entirely reasonable, but it doesn't work ( even though it did with Canvas2D ). If you use the trick adam showed (demonstrated in rect3) then it works. So it's fine, i can live with this, but i'm not sure it's as straightforward as it could be and i feel like there are going to be at least a few people who try to do what i'm trying to do in the rect2 example... Edit: Well the blue rect3 worked when i posted this at least. Now that i closed and reopened the tab the blue rectangle is in the same place as the green one. Don't know what happened there. Just a few minutes ago it worked. Edit2: http://playground.babylonjs.com/#E2TSU0#3
  14. Thank you! I downloaded the latest version using the version builder and was able to make left and right clicks.
  15. Yes i suppose. Action manager has: BABYLON.ActionManager.OnPickTrigger: BABYLON.ActionManager.OnLeftPickTrigger: BABYLON.ActionManager.OnRightPickTrigger: and i use the left and right pick triggers, not the first one that triggers on both.