Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kremedved

Pages: [1]
1
Support / tk2dButton, problem with the input
« on: September 18, 2013, 08:17:57 am »
I came across an issue: I have tk2Button at a scene and if Input.multitouch = true, I can press the button without pressing it - if you make two taps: to the left and to the right of the button, or above and below it. If we have Input.multitouch = false there is no such problem, but I need an active multitouch.
Unity3d 4.2, 2dt v2.2

2
Releases / Re: 2D Toolkit 2.2 final
« on: September 10, 2013, 03:52:15 pm »
It would take too long to explain. To cut it short, I need to change Y position of ClipCamera to make it work like in v2.1.

3
Releases / Re: 2D Toolkit 2.2 final
« on: September 10, 2013, 10:23:10 am »
Am I the only one to have problems with ClipCamera after the update from 2.1f + hotfix(unity 4.2)?

4
Support / Re: Discoloring of sprites
« on: September 06, 2013, 10:17:16 am »
Like this?

Quote
         fixed4 frag_mult(v2f_vct i) : COLOR
         {
            fixed4 col = tex2D(_MainTex, i.texcoord) * i.color;
            float coef = 0.3333f;
       
            fixed4 outCol = dot(fixed4(col.x * coef, col.y * coef, col.z * coef, 0), 1f);
            fixed4 ooo = fixed4(outCol.x, outCol.y, outCol.z, outCol.w / coef);
            return ooo;
         }
In this case, I really do not like the sprites are drawn on the edges / borders (which begins alpha channel)

Think, i find a solution of my problem ^^

Quote
         fixed4 frag_mult(v2f_vct i) : COLOR
         {
                fixed4 col = tex2D(_MainTex, i.texcoord);
                float3 w = float3(0.2125, 0.7154, 0.0721);
                float outCol = dot(float3(col.x, col.y, col.z), w);
                return fixed4(outCol,outCol,outCol,col.w);
         }

5
Support / Discoloring of sprites
« on: September 04, 2013, 03:28:45 pm »
Could you help me with making a shader of discoloring of sprites? There are some sprites in my game that need to be discolored, so that I wouldn't have to add graphics in color and with no color. I'm trying to modify the shader, but all I get is that the alpha-channel is displayed as black color.

Shader code:

Code: [Select]
// unlit, vertex colour, alpha blended
// cull off

Shader "tk2d/BlendVertexColor"
{
  Properties
  {
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  }
 
  SubShader
  {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    ZWrite Off Lighting Off Cull Off Fog { Mode Off } Blend SrcAlpha OneMinusSrcAlpha
    LOD 110
   
    Pass
    {
      CGPROGRAM
      #pragma vertex vert_vct
      #pragma fragment frag_mult
      #pragma fragmentoption ARB_precision_hint_fastest
      #include "UnityCG.cginc"

      sampler2D _MainTex;
      float4 _MainTex_ST;

      struct vin_vct
      {
        float4 vertex : POSITION;
        float4 color : COLOR;
        float2 texcoord : TEXCOORD0;
      };

      struct v2f_vct
      {
        float4 vertex : POSITION;
        fixed4 color : COLOR;
        float2 texcoord : TEXCOORD0;
      };

      v2f_vct vert_vct(vin_vct v)
      {
        v2f_vct o;
        o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
        o.color = v.color;
        o.texcoord = v.texcoord;
        return o;
      }

      fixed4 frag_mult(v2f_vct i) : COLOR
      {
        fixed4 col = tex2D(_MainTex, i.texcoord) * i.color;
        float coef = 0.3333f;
       
        fixed4 outCol = dot(fixed4(col.x * coef, col.y * coef, col.z * coef, 0), 1f);
        fixed4 ooo = fixed4(outCol.x, outCol.y, outCol.z, 1);
        return ooo;
      }
     
      ENDCG
    }
  }
 
  SubShader
  {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off Fog { Mode Off }
    LOD 100

    BindChannels
    {
      Bind "Vertex", vertex
      Bind "TexCoord", texcoord
      Bind "Color", color
    }

    Pass
    {
      Lighting Off
      SetTexture [_MainTex] { combine texture * primary }
    }
  }
}

6
Releases / Re: 2D Toolkit 2.2 beta 1
« on: August 17, 2013, 07:43:47 pm »
I have error, when i start scene "4 - UI Masks".

Quote
NullReferenceException: Object reference not set to an instance of an object
tk2dUIDemo2Controller.Start () (at Assets/TK2DROOT/tk2dUI_demo/tk2dUIDemo2Controller.cs:29)

rectMin[0] = windowLayout.GetMinBounds();

Unity version? Do you get the same result in an empty project?

4.2. Yes.

7
Releases / Re: 2D Toolkit 2.2 beta 1
« on: August 17, 2013, 05:37:16 pm »
I have error, when i start scene "4 - UI Masks".

Quote
NullReferenceException: Object reference not set to an instance of an object
tk2dUIDemo2Controller.Start () (at Assets/TK2DROOT/tk2dUI_demo/tk2dUIDemo2Controller.cs:29)

rectMin[0] = windowLayout.GetMinBounds();

8
Support / Re: multiple tap
« on: July 30, 2013, 02:06:52 pm »
I found a solution to my problem :)
Input.simulateMouseWithTouches = false;

9
Support / multiple tap
« on: July 30, 2013, 01:32:37 pm »
When tapping the screen multiple times, the middle coordinate between the taps is seen as the tap.
For example, if there is a button in the centre, and I tap to the left and to the right from it, then the button will be pressed. How do I fix this?

10
Support / Re: tk2dButton clicks doesn't work on Unity4.2 beta
« on: July 23, 2013, 11:31:04 am »
After the fix, the method name of tk2button occurs when I press the button down, but I need it to occur when I press the button up

11
Releases / Re: 2D Toolkit 1.92 final
« on: July 23, 2013, 11:06:07 am »
After unity3d had been upgraded to the version 4.2, pressing buttons do not work :<

12
Support / Re: font outline
« on: July 14, 2013, 06:27:17 pm »
Thanks! I think that solution would be the most appropriate one

13
Support / font outline
« on: July 14, 2013, 03:39:17 pm »
Hi! How can I change the color of the outline font, without creating a new font files(*.tga)?

14
Releases / Re: 2D Toolkit 1.90 final
« on: February 18, 2013, 08:10:12 pm »
If I create a sprite with collider type "ForcedNone" and then add tk2dButton to object is still created BoxCollider.
And if i write

tk2dSprite inventory;
inventory.boxCollider.enabled = false; //UnassignedReferenceException: The variable boxCollider of 'tk2dSprite' has not been assigned. You probably need to assign the boxCollider variable of the tk2dSprite script in the inspector.

if
inventory.GetComponent<BoxCollider>().enabled = false; //all fine!

Pages: [1]