(cls, lines, version)
return cls(data=data, version=version)
Create an instance based on .p8 data lines.

        The base implementation reads lines of ASCII-encoded hexadecimal bytes.

        Args:
          lines: .p8 lines for the section.
          version: The PICO-8 data version from the game file header.

        Returns:
          A Gfx instance.
Create an instance based on .p8 data lines.
Create an instance based on . p8 data lines .
def from_lines(cls, lines, version):
        """Create an instance based on .p8 data lines.

        The base implementation reads lines of ASCII-encoded hexadecimal bytes.

        Args:
          lines: .p8 lines for the section.
          version: The PICO-8 data version from the game file header.

        Returns:
          A Gfx instance.
        """
        datastrs = []
        for line in lines:
            if len(line) != 129:
                continue

            larray = list(line.rstrip())
            for i in range(0, 128, 2):
                (larray[i], larray[i+1]) = (larray[i+1], larray[i])

            larray_str = str(bytes(larray), encoding='ascii')
            datastrs.append(bytearray.fromhex(larray_str))

        data = b''.join(datastrs)
        return cls(data=data, version=version)
def from_lines ( cls , lines , version ) : datastrs = [ ] for line in lines : if len ( line ) != 129 : continue larray = list ( line . rstrip ( ) ) for i in range ( 0 , 128 , 2 ) : ( larray [ i ] , larray [ i + 1 ] ) = ( larray [ i + 1 ] , larray [ i ] ) larray_str = str ( bytes ( larray ) , encoding = 'ascii' ) datastrs . append ( bytearray . fromhex ( larray_str ) ) data = b'' . join ( datastrs ) return cls ( data = data , version = version )