コード例 #1
0
 internal MathNode(string mathInfix, string mathLaTeX, MathChallengeNode mathChallengeParent)
 {
     MathChallengeNode = mathChallengeParent;
     Scale             = 1f;
     AnchorPoint       = CCPoint.AnchorMiddle;
     AddChild(DrawNode);
     MathSprite = new MathSprite(mathInfix, mathLaTeX);
     AddChild(MathSprite, 1);
     MakeClickable(touchMustEndOnIt: false);
 }
コード例 #2
0
        internal void SetSize(CCSize size)
        {
            ContentSize = size;
            DrawNode.Clear();
            DrawNode.DrawRect(new CCRect(0, 0, size.Width, size.Height), CCColor4B.White);
            DrawNode.DrawRect(new CCRect(BORDER, BORDER, size.Width - 2 * BORDER, size.Height - 2 * BORDER), CCColor4B.Black);
            var mathSize = new CCSize(size.Width - 12 * BORDER, size.Height - 12 * BORDER);

            MathSprite.FitToBox(mathSize);
            MathSprite.Position = (CCPoint)ContentSize / 2;
        }