# automatically generated by the FlatBuffers compiler, do not modify

# namespace: AllWatchSerialize

import flatbuffers

class TextAttributes(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsTextAttributes(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = TextAttributes()
        x.Init(buf, n + offset)
        return x

    # TextAttributes
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # TextAttributes
    def FontSize(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # TextAttributes
    def FontFamily(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

    # TextAttributes
    def Text(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

    # TextAttributes
    def Color(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

def TextAttributesStart(builder): builder.StartObject(4)
def TextAttributesAddFontSize(builder, fontSize): builder.PrependInt16Slot(0, fontSize, 0)
def TextAttributesAddFontFamily(builder, fontFamily): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(fontFamily), 0)
def TextAttributesAddText(builder, text): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(text), 0)
def TextAttributesAddColor(builder, color): builder.PrependInt32Slot(3, color, 0)
def TextAttributesEnd(builder): return builder.EndObject()
