1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-26 10:19:22 +01:00

added default color to button

This commit is contained in:
Ellpeck 2019-12-06 21:18:43 +01:00
parent 548e603900
commit 31294f1873

View file

@ -8,6 +8,7 @@ namespace MLEM.Ui.Elements {
public class Button : Element {
public StyleProp<NinePatch> Texture;
public StyleProp<Color> NormalColor = Color.White;
public StyleProp<NinePatch> HoveredTexture;
public StyleProp<Color> HoveredColor;
public Paragraph Text;
@ -24,7 +25,7 @@ namespace MLEM.Ui.Elements {
public override void Draw(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) {
var tex = this.Texture;
var color = Color.White * alpha;
var color = (Color) this.NormalColor * alpha;
if (this.IsMouseOver) {
tex = this.HoveredTexture.OrDefault(tex);
color = (Color) this.HoveredColor * alpha;