def __init__(self, color): """ Constructor. :param color: the color to set the background to :type color: an integer, like 0xCCCCCC """ self.color = RGB(color)
class SetBackgroundColor(SwfTag): id = 9 min_version = 1 def __init__(self, color): """ Constructor. :param color: the color to set the background to :type color: an integer, like 0xCCCCCC """ self.color = RGB(color) def serialize_data(self): """ Serailizes this tag, according to the following format. ======= ========= Format Parameter ======= ========= RGB color ======= ========= """ return self.color.as_bitstream().serialize() def __repr_inner__(self): return "color=%s" % (self.color,) @classmethod def parse_inner(cls, bits): return cls(RGB.from_bitstream(bits).color)
class SetBackgroundColor(SwfTag): id = 9 min_version = 1 def __init__(self, color): """ Constructor. :param color: the color to set the background to :type color: an integer, like 0xCCCCCC """ self.color = RGB(color) def serialize_data(self): """ Serailizes this tag, according to the following format. ======= ========= Format Parameter ======= ========= RGB color ======= ========= """ return self.color.as_bitstream().serialize() def __repr_inner__(self): return "color=%s" % (self.color, ) @classmethod def parse_inner(cls, bits): return cls(RGB.from_bitstream(bits).color)
def parse_inner(cls, bits): CharacterID = bits.read(UI16) Bounds = Rect.from_bitstream(bits) bits.skip_flush() HasText = bits.read(Bit) WordWrap = bits.read(Bit) Multiline = bits.read(Bit) Password = bits.read(Bit) ReadOnly = bits.read(Bit) HasColor = bits.read(Bit) HasMaxLength = bits.read(Bit) HasFont = bits.read(Bit) HasFontClass = bits.read(Bit) AutoSize = bits.read(Bit) HasLayout = bits.read(Bit) NotSelectable = bits.read(Bit) HasBorder = bits.read(Bit) WasStatic = bits.read(Bit) IsHTML = bits.read(Bit) HasOutlines = bits.read(Bit) FontID = None FontClass = None FontSize = None Color = None MaxLength = None Layout = None Text = None if HasFont: FontID = bits.read(UI16) if HasFontClass: FontClass = bits.read(CString) if HasFont: FontSize = bits.read(UI16) if HasColor: Color = RGB.from_bitstream(bits) if HasMaxLength: MaxLength = bits.read(UI16) # if HasLayout: Layout = NonExistant.parse(bits) Variable = bits.read(CString) if HasText: Text = bits.read(CString) inst = cls(Bounds, Variable, Text, ReadOnly, IsHTML, WordWrap, Multiline, Password, AutoSize, not NotSelectable, HasBorder, Color, MaxLength, Layout, FontID, FontSize, FontClass, CharacterID) inst.wasstatic = WasStatic inst.outlines = HasOutlines return inst
def parse_inner(cls, bits): return cls(RGB.from_bitstream(bits).color)