Feature: Textboxes and other text-related features (#90)

* Textboxes: setup prefab

* Textboxes: basic functionality finished

* Textbox: scaling

* Textbox: open captions

* Textbox: res edits

* Textbox: song artist

* Textbox: closed captions

* Textbox: fix not being able to use multiple text events

* I/O: save / load remixes using UTF-8 encoding

* Textboxes: stop editor shortcuts while typing
This commit is contained in:
minenice55
2022-06-03 23:15:05 -04:00
committed by GitHub
parent 7e6d50ef26
commit 12fb8c2117
79 changed files with 22812 additions and 2017 deletions

View File

@ -0,0 +1,159 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ButtonSDFMaterial
m_Shader: {fileID: 4800000, guid: 574134bcfa99f7140a2cd7986bf57c25, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
- _BumpOutline: 0
- _BumpScale: 1
- _ColorMask: 15
- _CullMode: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _Diffuse: 0.5
- _DstBlend: 0
- _FaceDilate: 0
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowOuter: 0.05
- _GlowPower: 0.75
- _GradientScale: 5
- _LightAngle: 3.1416
- _MaskSoftnessX: 0
- _MaskSoftnessY: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _OffBright: 0.5
- _OutSmoothness: 0.001
- _OutThickness: 0.6
- _OutlineSoftness: 0
- _OutlineUVSpeedX: 0
- _OutlineUVSpeedY: 0
- _OutlineWidth: 0
- _Parallax: 0.02
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _SDFThreshold: 0.5
- _ScaleRatioA: 0.8
- _ScaleRatioB: 0.7
- _ScaleRatioC: 0.7
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
- _Sharpness: 0
- _Smoothness: 0.001
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SpecularPower: 2
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 512
- _TextureWidth: 512
- _Thickness: 0.9
- _UVSec: 0
- _UnderlayDilate: 0
- _UnderlayOffsetX: 0
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _UseUIAlphaClip: 0
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.5
- _WeightNormal: 0
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0035f9ee73a3659488de4969ea48d035
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,128 @@
Shader "UI/ButtonsSDFShader"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_OutColor ("Outline Colour", Color) = (1,1,1,1)
_Thickness("Thickness", Range(0, 1)) = 0.5
_Smoothness("Smoothness", Range(0, 1)) = 0.2
_OutThickness("Outline Thickness", Range(0, 1)) = 0.0
_OutSmoothness("Outline Smoothness", Range(0, 1)) = 0.1
_OffBright ("Off Brightness", Range(0, 1)) = 0.5
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
};
sampler2D _MainTex;
fixed4 _Color;
fixed4 _OutColor;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
float4 _MainTex_ST;
float _OffBright;
float _Thickness;
float _Smoothness;
float _OutThickness;
float _OutSmoothness;
v2f vert(appdata_t v)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = v.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
OUT.color = v.color * _Color;
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed a = tex2D(_MainTex, IN.texcoord).g;
fixed b = tex2D(_MainTex, IN.texcoord).r;
fixed o = smoothstep(_OutThickness - _OutSmoothness, _OutThickness + _OutSmoothness, b);
half4 color = _TextureSampleAdd + IN.color;
color.a = smoothstep(1.0 - _Thickness - _Smoothness, 1.0 - _Thickness + _Smoothness, b);
color.rgb = lerp(_OutColor.rgb, color.rgb * min(a + _OffBright, 1.0), o);
#ifdef UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 574134bcfa99f7140a2cd7986bf57c25
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,396 @@
fileFormatVersion: 2
guid: 149c162f840b9e9428b96653dd8e40ba
TextureImporter:
internalIDToNameTable:
- first:
213: 6719230046462009688
second: Pad
- first:
213: 3826735276939671808
second: Face
- first:
213: -6506423922138132652
second: ButtonOn
- first:
213: -8397132687541991269
second: WestOn
- first:
213: 111238229322356548
second: SouthOn
- first:
213: 8017398019882363653
second: NorthOn
- first:
213: -8244262083605341031
second: EastOn
- first:
213: -4789233240444048905
second: RightOn
- first:
213: -7319796363159512643
second: ButtonOff
- first:
213: 4213091988662033815
second: DownOn
- first:
213: 6847377428827266393
second: LeftOn
- first:
213: -5863448563183388835
second: UpOn
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 0
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Pad
rect:
serializedVersion: 2
x: 2
y: 955
width: 67
height: 67
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 851ef7390208f3d50800000000000000
internalID: 6719230046462009688
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Face
rect:
serializedVersion: 2
x: 71
y: 944
width: 78
height: 78
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 009f17f957b4b1530800000000000000
internalID: 3826735276939671808
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: ButtonOn
rect:
serializedVersion: 2
x: 151
y: 984
width: 38
height: 38
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 45f4ad25ae984b5a0800000000000000
internalID: -6506423922138132652
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: WestOn
rect:
serializedVersion: 2
x: 191
y: 944
width: 78
height: 78
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b980d338f44677b80800000000000000
internalID: -8397132687541991269
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: SouthOn
rect:
serializedVersion: 2
x: 271
y: 944
width: 78
height: 78
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 447d33884923b8100800000000000000
internalID: 111238229322356548
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: NorthOn
rect:
serializedVersion: 2
x: 351
y: 944
width: 78
height: 78
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 50b22066505834f60800000000000000
internalID: 8017398019882363653
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: EastOn
rect:
serializedVersion: 2
x: 431
y: 944
width: 78
height: 78
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 99c5b7f905f769d80800000000000000
internalID: -8244262083605341031
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: RightOn
rect:
serializedVersion: 2
x: 2
y: 886
width: 67
height: 67
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 7f9e6d40eb9398db0800000000000000
internalID: -4789233240444048905
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: ButtonOff
rect:
serializedVersion: 2
x: 151
y: 944
width: 38
height: 38
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: db95ea95dfbda6a90800000000000000
internalID: -7319796363159512643
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: DownOn
rect:
serializedVersion: 2
x: 71
y: 875
width: 67
height: 67
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 79d9e3e77d8e77a30800000000000000
internalID: 4213091988662033815
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: LeftOn
rect:
serializedVersion: 2
x: 140
y: 875
width: 67
height: 67
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 95dd6481e75c60f50800000000000000
internalID: 6847377428827266393
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: UpOn
rect:
serializedVersion: 2
x: 209
y: 875
width: 67
height: 67
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: d57fda00998d0aea0800000000000000
internalID: -5863448563183388835
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: