コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        public EnergyBarDecoration(DecorationTypeEnum type, Func <float> currentEnergy, Func <float> maxEnergy, float width, float height, CCColor4B background, CCColor4B foreground, CCColor4B textColor)
            : base(type, new EnergyBar(width, height))
        {
            BackgroundColor = background;
            ForegroundColor = foreground;
            TextColor       = textColor;

            Node.Initialize(currentEnergy, maxEnergy, () => BackgroundColor, () => ForegroundColor, () => TextColor);
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type"></param>
 /// <param name="text"></param>
 /// <param name="color"></param>
 public LabeledDecoration(DecorationTypeEnum type, Func <string> text, Func <CCColor3B> color)
     : base(type, new Label(text(), color()))
 {
     TextHolder  = text;
     ColorHolder = color;
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="node"></param>
 public EntityDecoration(DecorationTypeEnum type, T node)
 {
     DecorationType   = (int)type;
     Node             = node;
     Node.AnchorPoint = CCPoint.AnchorMiddle;
 }