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.


Topics - 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
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 }
    }
  }
}

3
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?

4
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)?

Pages: [1]