/// <summary>A more advanced Button constructor that deals with an animation manager.</summary> public Button(string name, Rectangle bounds, Texture2DExtended texture, string displayText, Rectangle sourceRect, float scale, Animations.Animation defaultAnimation, Dictionary <string, List <Animations.Animation> > animationsToPlay, string startingAnimationKey, Color drawColor, Color textColor, ButtonFunctionality functionality, int startingAnimationFrame = 0, bool animationEnabled = true, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture = null) : base(bounds, texture.getTexture(), sourceRect, scale) { this.animationManager = new Animations.AnimationManager(texture, defaultAnimation, animationsToPlay, startingAnimationKey, startingAnimationFrame, animationEnabled); this.label = displayText; this.name = name; this.textureColor = drawColor; // ?? IlluminateFramework.Colors.getColorFromList("White"); this.textColor = drawColor; // ?? IlluminateFramework.Colors.getColorFromList("White"); this.buttonFunctionality = functionality; this.extraTextures = extraTexture ?? new List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> >(); this.scale = scale; }
/// <summary> /// A more advanced Button constructor that deals with an animation manager. /// </summary> /// <param name="Name"></param> /// <param name="Bounds"></param> /// <param name="Texture"></param> /// <param name="displayText"></param> /// <param name="sourceRect"></param> /// <param name="Scale"></param> /// <param name="defaultAnimation"></param> /// <param name="animationsToPlay"></param> /// <param name="startingAnimationKey"></param> /// <param name="startingAnimationFrame"></param> /// <param name="AnimationEnabled"></param> public Button(string Name, Rectangle Bounds, Texture2DExtended Texture, string displayText, Rectangle sourceRect, float Scale, Animations.Animation defaultAnimation, Dictionary <string, List <Animations.Animation> > animationsToPlay, string startingAnimationKey, Color DrawColor, Color TextColor, ButtonFunctionality Functionality, int startingAnimationFrame = 0, bool AnimationEnabled = true) : base(Bounds, Texture.texture, sourceRect, Scale) { this.animationManager = new Animations.AnimationManager(Texture, defaultAnimation, animationsToPlay, startingAnimationKey, startingAnimationFrame, AnimationEnabled); this.label = displayText; this.name = Name; this.textureColor = DrawColor; if (this.textureColor == null) { this.textureColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); } this.textColor = DrawColor; if (this.textColor == null) { this.textColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); } this.buttonFunctionality = Functionality; }
/// <summary> /// Basic Button constructor. /// </summary> /// <param name="Bounds"></param> /// <param name="Texture">The texture sheet to be drawn to the screen. Used with the animation manager this allows you to reference different parts of the sheet at any given time.</param> /// <param name="sourceRect"></param> /// <param name="Scale"></param> /// <param name="defaultAnimation"></param> /// <param name="AnimationEnabled"></param> public Button(string Name, Rectangle Bounds, Texture2DExtended Texture, string displayText, Rectangle sourceRect, float Scale, Animations.Animation defaultAnimation, Color DrawColor, Color TextColor, ButtonFunctionality Functionality, bool AnimationEnabled = true, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture = null) : base(Bounds, Texture.getTexture(), sourceRect, Scale) { this.animationManager = new Animations.AnimationManager(Texture, defaultAnimation, AnimationEnabled); this.label = displayText; this.name = Name; this.textureColor = DrawColor; if (this.textureColor == null) { this.textureColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); } this.textColor = TextColor; if (this.textColor == null) { this.textColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); } this.buttonFunctionality = Functionality; if (extraTexture == null) { extraTexture = new List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> >(); } extraTextures = extraTexture; this.scale = Scale; }
/// <summary>Construct an instance.</summary> public SliderButton(string name, string displayText, Rectangle bounds, Texture2DExtended buttonTexture, Button barTexture, Rectangle sourceRect, float scale, SliderInformation sliderInformation, Animations.Animation defaultAnimation, Color drawColor, Color textColor, ButtonFunctionality buttonFunctionality, bool animationEnabled, Dictionary <string, List <Animations.Animation> > animationsToPlay, string startingKey, int startingAnimationFrame, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture, bool getLabelXYPos = true) : base(name, bounds, buttonTexture, displayText, sourceRect, scale, defaultAnimation, animationsToPlay, startingKey, drawColor, textColor, buttonFunctionality, startingAnimationFrame, animationEnabled, extraTexture) { this.sliderInformation = sliderInformation; this.getLabelXYPos = getLabelXYPos; this.sliderBar = barTexture; this.initializeBounds(); }
public CycleButton(string name, string displayText, Rectangle bounds, List <Button> buttons, Rectangle sourceRect, float scale, Animations.Animation defaultAnimation, Color drawColor, Color textColor, ButtonFunctionality buttonFunctionality, bool animationEnabled, Dictionary <string, Animations.Animation> animationsToPlay, string startingKey, int startingAnimationFrame, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture) : base(name, bounds, buttons.ElementAt(0).animationManager.getExtendedTexture(), displayText, sourceRect, scale, defaultAnimation, animationsToPlay, startingKey, drawColor, textColor, buttonFunctionality, startingAnimationFrame, animationEnabled, extraTexture) { this.buttons = buttons; this.buttonIndex = 0; }
/// <summary> /// Constructor. /// </summary> /// <param name="Name"></param> /// <param name="displayText"></param> /// <param name="bounds"></param> /// <param name="buttonTexture"></param> /// <param name="barTexture"></param> /// <param name="SourceRect"></param> /// <param name="scale"></param> /// <param name="sliderInformation"></param> /// <param name="defaultAnimation"></param> /// <param name="DrawColor"></param> /// <param name="TextColor"></param> /// <param name="buttonFunctionality"></param> /// <param name="AnimationEnabled"></param> /// <param name="extraTexture"></param> /// <param name="getLabelXYPos"></param> public SliderButton(string Name, string displayText, Rectangle bounds, Texture2DExtended buttonTexture, Button barTexture, Rectangle SourceRect, float scale, SliderInformation sliderInformation, Animations.Animation defaultAnimation, Color DrawColor, Color TextColor, ButtonFunctionality buttonFunctionality, bool AnimationEnabled, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture, bool getLabelXYPos = true) : base(Name, bounds, buttonTexture, displayText, SourceRect, scale, defaultAnimation, DrawColor, TextColor, buttonFunctionality, AnimationEnabled, extraTexture) { this.sliderInformation = sliderInformation; this.getLabelXYPos = getLabelXYPos; this.sliderBar = barTexture; initializeBounds(); }
public CycleButton(string Name, string displayText, Rectangle bounds, List <Button> buttons, Rectangle SourceRect, float scale, Animations.Animation defaultAnimation, Color DrawColor, Color TextColor, ButtonFunctionality buttonFunctionality, bool AnimationEnabled, List <KeyValuePair <ClickableTextureComponent, ExtraTextureDrawOrder> > extraTexture) : base(Name, bounds, buttons.ElementAt(0).animationManager.getExtendedTexture(), displayText, SourceRect, scale, defaultAnimation, DrawColor, TextColor, buttonFunctionality, AnimationEnabled, extraTexture) { this.buttons = buttons; this.buttonIndex = 0; }