1 module evael.graphics.gui.Background; 2 3 import evael.graphics.gui.StateList; 4 5 import evael.utils.Color; 6 7 import jsonizer; 8 9 alias ColorStateList = StateList!Color; 10 11 struct Background 12 { 13 mixin JsonizeMe; 14 15 enum Type : ubyte 16 { 17 Transparent, 18 Solid, 19 Sprite 20 } 21 22 private @jsonize("type") Type m_type; 23 private @jsonize("colorStateList") ColorStateList m_colorStateList; 24 25 @nogc 26 public this()(in auto ref Type type, auto ref ColorStateList value) nothrow 27 { 28 this.m_type = type; 29 this.m_colorStateList = value; 30 } 31 32 /** 33 * Properties 34 */ 35 @nogc 36 @property nothrow 37 { 38 public Type type() const 39 { 40 return this.m_type; 41 } 42 43 public void type(in Type value) 44 { 45 this.m_type = value; 46 } 47 48 public void colorStateList()(in auto ref ColorStateList value) 49 { 50 this.m_colorStateList = value; 51 } 52 53 public auto colorStateList() 54 { 55 return this.m_colorStateList; 56 } 57 58 /* public void sprite()(in auto ref Sprite value) nothrow @nogc 59 { 60 this.m_data.sprite = value; 61 }*/ 62 } 63 64 }