Drawbitmap coordinates


(NL) #1

Hello.

1st: How can i do to avoid a bitmap disappear (with drawbitmap) when it’s top left corner coordinates are out of screen range ?

2nd : is it possible to change the top left coordinate for midle coordinates of a bitmap?


(Matt) #2

Which drawBitmap method are you using? Arduboy2? ArdBitmap?

The bitmap should still get drawn even if its upper left coordinate is off screen. Can you share some code?

You can change to middle of bitmap with your own code, but I don’t know of any bitmap functions that support that directly. Instead of doing drawBitmap(x, y, bitmap) you’d just need to do drawBitmap(x - width / 2, y - height / 2, bitmap), assuming you have width and height handy.


(NL) #3

Thank you I found the answer. I was using uint8_t instead of int8_t.


(Matt) #4

ah yup, been there many times :slight_smile: