예제 #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();
        }