Hi,
Had some (hopefully) simple questions about buttons, best practices and which is most efficient to use for memory and processing.
Can you please confirm my understanding of a button and it's 3 basic parts:
Note these questions are pertaining to Visi-Genie specifically
1. img_ClearAttributes(...)
Recently I have started encountering some issues such as STACK OVERFLOW and my display freezing. I wanted to start eliminating where the cause could be coming from.
I use a lot of custom Userimages as buttons because my buttons can have 2, 3 or 4 unique states. My thought process here is that I didn't want to have conflicts with the the predefined Userbutton properties. Am I correct in this line of though? Should I be using Userbuttons instead? Are userimages as buttons more resource intensive than userbuttons?
Thanks in advance,
Justin
Had some (hopefully) simple questions about buttons, best practices and which is most efficient to use for memory and processing.
Can you please confirm my understanding of a button and it's 3 basic parts:
Note these questions are pertaining to Visi-Genie specifically
1. img_ClearAttributes(...)
- This enables a userbutton, winbutton, userimage or whatever object you want to respond to touches.
- This should be done for every button used in a magiccode, magicevent, ect. (for instance ImageTouched = iUserimages14 or WriteObject(tUserimage) )
- It is not necessary or should not be done when winbutton, userbutton, userimage have an action in the onchanged event handler (for instance Form37Activate or Report Message)
- Displays button, at it's current state. Initial state is 0. After indexing image, img_show should be done again to refresh the appearance due to the new state.
- an initial img_show is not necessary in visi-genie as the button, image, ect will be shown in it's initial state.
- WriteObject(tUserbutton) can be used instead of img_Show(..) => img_SetWord(... image_index ...) => img_Show(...) to display a refreshed image state.
- the action to change the button state (on, off) (on, onpressed, off, offpressed)
- Not necessary or should not be done as it is already handled in the button "Momentary" properties.
Recently I have started encountering some issues such as STACK OVERFLOW and my display freezing. I wanted to start eliminating where the cause could be coming from.
I use a lot of custom Userimages as buttons because my buttons can have 2, 3 or 4 unique states. My thought process here is that I didn't want to have conflicts with the the predefined Userbutton properties. Am I correct in this line of though? Should I be using Userbuttons instead? Are userimages as buttons more resource intensive than userbuttons?
Thanks in advance,
Justin
Comment