Is there or can you add an origin command? #2192
Replies: 4 comments 1 reply
-
There is no capability to do this in the library. So the sketch will need to adjust all coordinates to emulate a different datum. It is possible to move the datum when the setViewport function is used, but all graphics are constrained to the viewport zone so this will not cater for the case where coordinates are negative wrt the datum. |
Beta Was this translation helpful? Give feedback.
-
I think this should be straightforward to add as the library already handles origin offsets for the viewport, the trick is to not change the screen viewport area. I have added some new functions to a test branch as follows: The test branch is here ready for direct download from Github: If you could test this new feature and, providing it works for multiple cases (including +x, -x, +y, -y off-screen origin cases), then let me know. It should also work with origins in sprites. If you can create a very simple commented example for the library to demonstrate the new feature then I can add it. |
Beta Was this translation helpful? Give feedback.
-
I will have a look at the weekend. due to work commitments. Thankyou for taking time out to add this.--Sent from my Android phone with mail.com Mail. Please excuse my brevity.On 23/11/2022, 00:16 Bodmer ***@***.***> wrote:
I think this should be straightforward to add as the library already handles origin offsets for the viewport, the trick is to not change the screen viewport area.
I have added some new functions to a test branch as follows: https://github.com/Bodmer/TFT_eSPI/blob/setOrigin-test/TFT_eSPI.h#L452-L456
The test branch is here ready for direct download from Github: https://github.com/Bodmer/TFT_eSPI/tree/setOrigin-test
If you could test this new feature and, providing it works for multiple cases (including +x, -x, +y, -y off-screen origin cases), then let me know. It should also work with origins in sprites.
If you can create a very simple commented example for the library to demonstrate the new feature then I can add it.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Had a little play with just basic drawing GFX and it seems to work, not done a lot as work gone crazy, one thing i did notice if you make it permanent, setbackground function needs to read custom origen, set to 0,0 then restore or hard code 0,0 as it doesn't clear the screen--Sent from my Android phone with mail.com Mail. Please excuse my brevity.On 23/11/2022, 06:29 Gary Metheringham ***@***.***> wrote:
I will have a look at the weekend. due to work commitments.
Thankyou for taking time out to add this.
…--
Sent from my Android phone with mail.com Mail. Please excuse my brevity.
On 23/11/2022, 00:16 Bodmer ***@***.***> wrote:
I think this should be straightforward to add as the library already handles origin offsets for the viewport, the trick is to not change the screen viewport area.
I have added some new functions to a test branch as follows: https://github.com/Bodmer/TFT_eSPI/blob/setOrigin-test/TFT_eSPI.h#L452-L456
The test branch is here ready for direct download from Github: https://github.com/Bodmer/TFT_eSPI/tree/setOrigin-test
If you could test this new feature and, providing it works for multiple cases (including +x, -x, +y, -y off-screen origin cases), then let me know. It should also work with origins in sprites.
If you can create a very simple commented example for the library to demonstrate the new feature then I can add it.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
somthing like
origin(Width/2, Height/2)
to force the display to think that 0,0 is center of screen so a -number is top half and +number is bottom half,
origin (0,Height)
would make bottom left corner 0,0 resulting in only -numbers to draw in Y-axis etc?
Beta Was this translation helpful? Give feedback.
All reactions