krzysztof.s

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. I made a playground http://www.babylonjs-playground.com/#1FK6IP#0 Interesting, in playground it is working I got new canvas2d from: https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/canvas2D/babylon.canvas2d.js and it seems to be fixed, i was late with reporting, thanks
  2. I want to have only one texture and have a possibility to have multiple instances on a scene, and multiply original texture's pixels' colors by some custom color, like color property in NGUI's Sprite, or like material's color in Unity's Image, or like 'tint' property in Phaser's Sprite. In every engine using OpenGl it is finally done on GPU with cusom shader like this: CGPROGRAM #pragma vertex vert #pragma fragment frag sampler2D _MainTex; struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; fixed4 color : COLOR; }; struct v2f { float4 vertex : SV_POSITION; half2 texcoord : TEXCOORD0; fixed4 color : COLOR; }; v2f o; v2f vert (appdata_t v) { o.vertex = mul( MATRIX_MVP, v.vertex ); o.texcoord = v.texcoord; o.color = v.color; return o; } fixed4 frag (v2f IN) : COLOR { return tex2D(_MainTex, IN.texcoord) * IN.color; } ENDCG You can see that vertex color ( my 'custom color' ) is multiplied with texture color. I am looking this behaviour in Babylon's Sprite2D.
  3. Is there any possibility to set custom color in Sprite2D? For now there is only opacity property.
  4. PrimitivePointerInfo.PointerEnter and PrimitivePointerInfo.PointerLeave are not send to Sprite2D when Sprite2D is added to ScreenSpaceCanvas2D as child. Only ScreenSpaceCanvas2D receive these events. ScreenSpaceCanvas2D has 'enableInteractions : true' and my Sprite2D has 'isPickable : true'. background.pointerEventObservable.add( ( d, s )=>{ console.log("background enter") background.opacity = 0.5; }, BABYLON.PrimitivePointerInfo.PointerEnter ); background.pointerEventObservable.add( ( d, s )=>{ console.log("background exit") background.opacity = 1.0; }, BABYLON.PrimitivePointerInfo.PointerLeave ); background.pointerEventObservable.add(function (d, s) { console.log("background CLICK") }, BABYLON.PrimitivePointerInfo.PointerUp); Only PointerUp event is handled. When i was figuring it out i found following comment in babylon.canvas2d.js: If i restore commended code, events are coming, but i am not sure it is properly way ;-) I'm using babylon 2.6.0