Esempio n. 1
0
        /// <summary>
        /// Apply translation to a container
        /// </summary>
        /// <param name="container"></param>
        /// <param name="tranlations"></param>
        private void ApplyTranslation(Container container, List <Translation> tranlations = null)
        {
            if (tranlations != null)
            {
                foreach (Control c in container.Controls)
                {
                    if (c is ITranslatable)
                    {
                        ITranslatable tControl = (ITranslatable)c;

                        if (!string.IsNullOrEmpty(tControl.TranslateKey))
                        {
                            if (c is ITextRenderable)
                            {
                                ITextRenderable textControl = (ITextRenderable)c;
                                textControl.Text = (from t in tranlations where t.Key == tControl.TranslateKey select t).Single().Value;
                            }
                        }
                    }
                }
            }
            else
            {
                throw new GuiEngineException(typeof(GuiShot).Name, "Obligé d'avoir un liste de traduction !!!!");//todo add in ressources
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="text"></param>
 public void removeText(ITextRenderable text)
 {
     m_texts.Remove(text);
 }
Esempio n. 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="text"></param>
 public void addText(ITextRenderable text)
 {
     m_texts.Add(text);
 }
        public override void Initialize()
        {
            scoreText = ParentGameObject.GetComponent<IRenderComponent>().GetRenderable("score") as ITextRenderable;

            base.Initialize();
        }
        public override void Initialize()
        {
            scoreText = ParentGameObject.GetComponent <IRenderComponent>().GetRenderable("score") as ITextRenderable;

            base.Initialize();
        }