1
Discussion - EVE / Re: Touch tag not working properly
« on: September 26, 2023, 01:57:49 PM »
Hi,
The CLEAR_TAG is intended to set the value to which the tag buffer is initialised and so you can do this before your clear(1,1,1). For example, here we set the tag buffer to 255. When you touch your rectangle, you should get tag 151 and if you touch an untagged area then you should get tag 255. Alternatively, you can remove CLEAR_TAG and the CLEAR(1,1,1) will clear the tag buffer to default.
Also (if you will run your display list constantly in a loop to update items on the screen) you can load the image from flash just once so that it does not happen on each screen update
Best Regards, BRT Community
The CLEAR_TAG is intended to set the value to which the tag buffer is initialised and so you can do this before your clear(1,1,1). For example, here we set the tag buffer to 255. When you touch your rectangle, you should get tag 151 and if you touch an untagged area then you should get tag 255. Alternatively, you can remove CLEAR_TAG and the CLEAR(1,1,1) will clear the tag buffer to default.
Also (if you will run your display list constantly in a loop to update items on the screen) you can load the image from flash just once so that it does not happen on each screen update
Best Regards, BRT Community
Code: [Select]
Gpu_CoCmd_FlashRead(phost, 4096, 4096, 261120);
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR_TAG(255));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
Gpu_CoCmd_SetBitmap(phost, 4096, ARGB1555, 480, 272);
App_WrCoCmd_Buffer(phost, COLOR_A(245));
App_WrCoCmd_Buffer(phost, VERTEX2II(0, 0, 0, 0));
App_WrCoCmd_Buffer(phost, TAG_MASK(1));
App_WrCoCmd_Buffer(phost, TAG(151));
App_WrCoCmd_Buffer(phost, BEGIN(RECTS));
App_WrCoCmd_Buffer(phost, VERTEX2F(400, 1040));
App_WrCoCmd_Buffer(phost, VERTEX2F(3616, 1344));
App_WrCoCmd_Buffer(phost, TAG_MASK(0));