mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 22:18:34 +01:00
added default color to button
This commit is contained in:
parent
548e603900
commit
31294f1873
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue