Ejemplo n.º 1
0
        public Selection(Word p_StudyInfo, bool p_IsAnswer,Int32 p_Width,Int32 p_Height)
        {
            base.init();
            this.StudyInfo = p_StudyInfo;

            CCTexture2D texture = new CCTexture2D();
            texture.initWithTexture(PictureManager.GetTexture2D(p_StudyInfo));

            if (p_Width < texture.ContentSizeInPixels.width)
            {
                this.scaleX = p_Width / texture.ContentSizeInPixels.width;
            }
            if (p_Height < texture.ContentSizeInPixels.height)
            {
                this.scaleY = p_Height / texture.ContentSizeInPixels.height;
            }
            this.contentSize.width = p_Width;
            this.contentSize.height = p_Height;

            CCRect rect = new CCRect();
            rect.size = new CCSize(texture.ContentSizeInPixels.width, texture.ContentSizeInPixels.height);
            this.initWithTexture(texture, rect);

            this.IsAnswer = p_IsAnswer;
            LoadResultPeople();
        }
Ejemplo n.º 2
0
        public static CCTexture2D GetCCTexture2D(Word p_Word,Int32 p_Width,Int32 p_Height,bool p_Zoom)
        {
            CCTexture2D result = new CCTexture2D();
            result.initWithTexture(GetTexture2D(p_Word),new CCSize(p_Width,p_Height));

            return result;
        }
Ejemplo n.º 3
0
 public FloorLayer(Word p_Word)
 {
     base.init();
     m_Size = CCDirector.sharedDirector().getWinSize();
     this.isTouchEnabled = true;
     m_Word = p_Word;
     SayAction = new QuestionAction(m_Word);
 }
Ejemplo n.º 4
0
 public static Texture2D GetTexture2D(Word p_Word)
 {
     if (p_Word.IsContent)
     {
         return Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, Content.Current.ReadFile(p_Word.PictureFilePath));
     }
     else
     {
         return Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, Storage.Current.ReadFile(p_Word.PictureFilePath));
     }
 }
Ejemplo n.º 5
0
 public static void Play(Language p_Language, Word p_Word)
 {
     switch (p_Language)
     {
         case Language.Chinese:
             if (p_Word.HasChineseAudio)
             {
                 Play(p_Word.ChineseAudioFilePath);
             }
             else
             {
                 if (!NetworkManage.Current.IsConnection)
                 {
                     throw new MessageException("无网络");
                 }
                 TextToSpeech.Current.GetSound(
                     Language.Chinese.GetDescription(),
                     p_Word.ChineseName,
                     (obj) => {
                         Storage.Current.CreateFile(p_Word.ChineseAudioFilePath, Lib.Core.ByteBuffe.FromStream(obj).ToArrary());
                         MediaPlay.Current.Play(p_Word.ChineseAudioFilePath);
                     });
             }
             break;
         case Language.Enlish:
         default:
             if (p_Word.HasEnglishAudio)
             {
                 Play(p_Word.EnglishAudioFilePath);
             }
             else
             {
                 if (!NetworkManage.Current.IsConnection)
                 {
                     throw new MessageException("无网络");
                 }
                 TextToSpeech.Current.GetSound(
                      Language.Enlish.GetDescription(),
                      p_Word.EnglishName,
                      (obj) => {
                          Storage.Current.CreateFile(p_Word.EnglishAudioFilePath, Lib.Core.ByteBuffe.FromStream(obj).ToArrary());
                          MediaPlay.Current.Play(p_Word.EnglishAudioFilePath);
                      });
             }
             break;
     }
 }
Ejemplo n.º 6
0
 public static void Play(Language p_Language, Word p_Word)
 {
     switch (p_Language)
     {
         case Language.Chinese:
             if (p_Word.HasChineseAudio)
             {
                 p_Word.PlayChinese();
             }
             else
             {
                 if (!Lib.Network.NetworkManage.IsConnection)
                 {
                     throw new MessageException("无网络");
                 }
                 TextToSpeech.TextToSpeech down = new TextToSpeech.TextToSpeech();
                 down.GetSoud(Language.Chinese, p_Word);
             }
             break;
         case Language.Enlish:
         default:
             if (p_Word.HasEnglishAudio)
             {
                 p_Word.PlayEnglish();
             }
             else
             {
                 if (!Lib.Network.NetworkManage.IsConnection)
                 {
                     throw new MessageException("无网络");
                 }
                 TextToSpeech.TextToSpeech down = new TextToSpeech.TextToSpeech();
                 down.GetSoud(Language.Enlish, p_Word);
             }
             break;
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="p_Word"></param>
 /// <returns></returns>
 public static bool Insert(Word p_Word)
 {
     SQLiteCommand comm = myDB.CreateCommand(String.Format(SqlInsert, TableName,
         p_Word.ChineseName, p_Word.EnglishName,
         p_Word.PictureFile,Convert.ToInt32(p_Word.IsContent)));
     return comm.ExecuteNonQuery() > 0;
 }
Ejemplo n.º 8
0
 public AddWordLayer()
 {
     base.init ();
     m_Word = new Word ();
 }
Ejemplo n.º 9
0
 public QuestionAction(Word p_Word)
 {
     m_Word = p_Word;
 }
Ejemplo n.º 10
0
 public void GetSoud(Language p_Language,Word p_Word)
 {
 }
Ejemplo n.º 11
0
 public static Texture2D GetTexture2D(Word p_Word)
 {
     return Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice,FileLoader.ReadFile(p_Word.IsContent,p_Word.PictureFilePath));
 }
Ejemplo n.º 12
0
 public static Texture2D GetTexture2D(Word p_Word,Int32 p_Width,Int32 p_Height,bool p_Zoom)
 {
     return Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, FileLoader.ReadFile(p_Word.IsContent, p_Word.PictureFilePath), p_Width, p_Height, p_Zoom);
 }
Ejemplo n.º 13
0
 public static CCTexture2D GetCCTexture2D(Word p_Word, Int32 p_Width, Int32 p_Height, bool p_Zoom)
 {
     Texture2D text2D = GetTexture2D(p_Word,p_Width,p_Height,p_Zoom);
     CCTexture2D cctext2D = new CCTexture2D();
     cctext2D.initWithTexture(text2D);
     return cctext2D;
 }
Ejemplo n.º 14
0
 public static CCTexture2D GetCCTexture2D(Word p_Word)
 {
     CCTexture2D result = new CCTexture2D();
     result.initWithTexture(GetTexture2D(p_Word));
     return result;
 }