public UncachedTextIndicator(IConfig config, StyleProvider styleProvider) { // TODO add more configuration for text size, etc _labelText = string.Empty; Style = styleProvider.GetStyle(config.GetString(CfgStyleName)); var strCfgLayer = config.GetString(CfgLayer); if (Enum.TryParse(strCfgLayer, out DrawLayer layer)) { Layer = layer; } else { throw new ArgumentException($"Could not parse {strCfgLayer} as DrawLayer"); } var strCfgLod = config.GetString(CfgLevelOfDetail); if (Enum.TryParse(strCfgLod, out DrawLevelOfDetail lod)) { LevelOfDetail = lod; } else { throw new ArgumentException($"Could not parse {strCfgLod} as DrawLevelOfDetail"); } }
public BoxSprite(IConfig config, StyleProvider styleProvider) { Height = config.GetFloat(CfgHeight); Width = config.GetFloat(CfgWidth); Filled = config.GetBool(CfgFilled, false); Rounded = config.GetBool(CfgRounded, false); Style = styleProvider.GetStyle(config.GetString(CfgStyleName)); }
public HexagonSprite(IConfig config, StyleProvider styleProvider) { Radius = config.GetFloat(CfgRadius); Filled = config.GetBool(CfgFilled, false); Style = styleProvider.GetStyle(config.GetString(CfgStyleName)); }