676
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 22, 2019, 10:29:33 AM »
One thing to add regarding buttons is that we find using bitmap icons is often a good way where you have lots of buttons. If your icons are all the same size, using bitmap cells (where you create a large bitmap image which is one button wide and many buttons high) is a really handy way of doing this with minimal display list content plus you can give the icons your own desired appearance. You then place the icon by VERTEX2II which includes the handle and the specific cell number you want to place. Or by the CELL instruction followed by VERTEX2F.
There are several ways to implement this including:
- add a slightly larger rectangle behind to give a glow round the edges
- set COLOR_RGB before the icon is placed and re-color to indicate pressed
With most of these methods you can also keep the display list size the same regardless of button state.
As you mentioned, it is often quite efficient to re-send the entire list especially when using SPI burst writes when something on the screen changes if you have a lot of dynamic objects. For anyone looking to use the append in the original way (with RAM_DL content rather than commands) then you may also find using icons rather than buttons along with using multiple appended sections as smaller building blocks helps to minimise variation in length of the DL.
Thanks for your inputs Rudolph and Jesse, I'm sure your experiences here will help other users too,
Best Regards,
BRT Community
There are several ways to implement this including:
- Having one image per icon and use conditional code to do one of the following when a variable indicates the button should be 'pressed'
- add a slightly larger rectangle behind to give a glow round the edges
- set COLOR_RGB before the icon is placed and re-color to indicate pressed
- Having more than one image per icon which you select using the cell number using similar conditional code:
Code: [Select]
TAG_MASK(1);
BEGIN(BITMAPS)
COLOR_RGB(255,255,255) // white displays following bitmaps in their original colours
TAG(Button_0);
If(Button0_Pressed == false) // Button0_pressed is a local Boolean in your code
VERTEX2II(100,100,5,0) // display cell 0 which is your button 0 unpressed
Else
VERTEX2II(100,100,5,1) // display cell 1 which is your button 0 pressed
With most of these methods you can also keep the display list size the same regardless of button state.
As you mentioned, it is often quite efficient to re-send the entire list especially when using SPI burst writes when something on the screen changes if you have a lot of dynamic objects. For anyone looking to use the append in the original way (with RAM_DL content rather than commands) then you may also find using icons rather than buttons along with using multiple appended sections as smaller building blocks helps to minimise variation in length of the DL.
Thanks for your inputs Rudolph and Jesse, I'm sure your experiences here will help other users too,
Best Regards,
BRT Community