pixelit-project / PixelIt

PixelIt is an ESP8266/ESP32 and WS2812B LED Matrix based PixelArt display
https://pixelit-project.github.io
MIT License
333 stars 51 forks source link

Bitmap not working with unmoving text display #175

Closed richardjm closed 2 years ago

richardjm commented 2 years ago

Expected behaviour - text appears beside icon. What happens - text appears on the left without icon.

REST call - change "Hello World" to "Hello" or set "scrollText" to false to create issue

{
    "bitmap": {
        "data": [0, 52857, 52857, 52857, 52857, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 0, 52857, 53247, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 52857, 0, 0, 0, 0, 52857, 0, 0, 0, 52857, 0, 0, 0, 52857, 52857, 52857, 52857, 52857, 0, 0]
    },
    "text": {
        "textString": "Hello World",
        "bigFont": false,
        "scrollText": "auto",
        "centerText": false,
        "color": {
            "r": 255,
            "g": 255,
            "b": 255
        }
    }
}

Workaround is to use a call like

{
    "bitmapAnimation": {
        "data": [ [0, 52857, 52857, 52857, 52857, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 0, 52857, 53247, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 52857, 0, 0, 0, 0, 52857, 0, 0, 0, 52857, 0, 0, 0, 52857, 52857, 52857, 52857, 52857, 0, 0]]
    },
    "text": {
        "textString": "Hello World",
        "bigFont": false,
        "scrollText": false,
        "centerText": false,
        "position": {
            "x": 8,
            "y": 1
        },
        "color": {
            "r": 255,
            "g": 255,
            "b": 255
        }
    }
}
rliegmann commented 2 years ago

Hi richardjm,

I took up the topic. In the appendix I have attached my releases with the adjustment. Can you test this? It is important here that the position is also sent under "bitmap". This is required because it would otherwise be 0. This command works for me:

{
    "bitmap": {
        "data": [0, 52857, 52857, 52857, 52857, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 0, 52857, 53247, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 52857, 0, 0, 0, 0, 52857, 0, 0, 0, 52857, 0, 0, 0, 52857, 52857, 52857, 52857, 52857, 0, 0],

        "size": {
            "width": 8,
            "height": 8
        }
    },
    "text": {
        "textString": "Hello World",
        "bigFont": false,
        "scrollText": "false",
        "centerText": false,
        "color": {
            "r": 255,
            "g": 255,
            "b": 255
        }
    }
} 

Bugfix Scroll.zip

If it works I will create a pull request.

LG partytown :-)

o0shojo0o commented 2 years ago

I just see that the API is not called correctly by you . The size of the bitmap was forgotten:

"size": {
    "width": 8,
    "height": 8
}

and for the text the position:

"position": {
    "x": 8,
    "y": 1
},

The correct call must look like this:

{
    "bitmap": {
        "data": [0, 52857, 52857, 52857, 52857, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 52857, 53247, 53247, 53247, 52857, 0, 0, 0, 0, 52857, 53247, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 0, 0, 0, 0, 0, 52857, 0, 52857, 0, 0, 0, 0, 52857, 0, 0, 0, 52857, 0, 0, 0, 52857, 52857, 52857, 52857, 52857, 0, 0],        
        "size": {
            "width": 8,
            "height": 8
        }
    },
    "text": {
        "textString": "Hello World",
        "bigFont": false,
        "scrollText": "false",
        "centerText": false,
         "position": {
            "x": 8,
            "y": 1
        },
        "color": {
            "r": 255,
            "g": 255,
            "b": 255
        }
    }
}