예제 #1
0
        public static Config RandomConfig(string sentence)
        {
            var randomPolys = new PolygonConfig[Random.Range(1, 3)];

            for (int i = 0; i < randomPolys.Length; i++)
            {
                randomPolys[i] = PolygonConfig.RandomConfig();
            }
            return(new Config(
                       new Alphabet(),
                       sentence,
                       BorderConfig.RandomConfig(),
                       randomPolys,
                       BorderConfig.RandomConfig(),
                       null,
                       .5f
                       ));
        }
예제 #2
0
 public Config(
     Alphabet alphabet,
     string sentence,
     BorderConfig borderConfig,
     PolygonConfig[] polygonConfigs,
     BorderConfig innerBorderConfig,
     PolygonConfig innerPolygonConfig,
     float textSize
     )
 {
     this.alphabet           = alphabet;
     this.sentence           = sentence.ToUpper();
     this.borderConfig       = borderConfig;
     this.polygonConfigs     = polygonConfigs;
     this.innerBorderConfig  = innerBorderConfig;
     this.innerPolygonConfig = innerPolygonConfig;
     this.textSize           = textSize;
 }
예제 #3
0
        private float DrawBorder(float maxRadius, Vector2 middleCords, BorderConfig borderConfig)
        {
            float remainingRadius = 1f;

            foreach (var type in borderConfig.GetBorderTypes())
            {
                switch (type)
                {
                case BorderType.Line:
                    drawingTool.Circle(middleCords, maxRadius * remainingRadius, lineThickness);
                    break;

                case BorderType.Text:
                    CircleText(middleCords, maxRadius * remainingRadius, ((maxRadius * remainingRadius) / 20.0f) * config.GetTextSize());
                    break;
                }

                remainingRadius -= 0.05f;
            }

            return(remainingRadius * maxRadius);
        }