Page 1 of 2
Priority of interface objects
Posted: Thu Mar 24, 2016 6:05 am
by rbytes
Just wondering if there is a set priority for interface objects. I am working on a new version of Radio Star. I have created transparent buttons that overlay the green rectangles on screen right, identifying the songs. I want to enable users to instantly skip to any song just by pressing anywhere in any of the rectangles.
But there are three fields within each song description, and they seem to have a higher priority than the buttons. If I press anywhere but in the blank upper right corner of a song rectangle, I get no response from the button. I assume that it is blocked elsewhere by the fields.
Any way to unblock it? As a feature request, I think it would be a good thing to give buttons the highest priority, since in designing a program I doubt if a programmer would ever place a button over an object that also needed touch access. I can definitely see the value of being able to put a button on top of an RO field, though. That way one could have buttons containing (or seeming to contain) multiple lines of text.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 6:43 am
by Mr. Kibernetik
In sB overlapping order is defined by order of object creation. Later created objects overlap earlier created objects. So one can control objects overlapping of any complexity. Any kind of automatic reordering can be problematic and not universal.
Also please don't forget pages functionality. For example overlapping buttons can belong to separate page which can be put on top. Pages also have their own transparency, can be reordered and moved.
Also sprites can be used as a touchable graphics, or just touches can be analyzed inside known rectangular areas.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 1:39 pm
by rbytes
Yes, it seemed to me that interface objects created later would have higher priority, but I am creating the buttons after the fields, and it makes no difference. The buttons still won't respond in the areas where the fields are.
I will try one of the other suggestions. Thanks.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 1:53 pm
by Mr. Kibernetik
If you create text field first, then you create button, and then you change field text, then field text overlaps the button.
Because changing field text recreates the field with new text.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 2:46 pm
by rbytes
Thanks. That explains it.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 3:26 pm
by rbytes
I didn't realize realize that interface object priorities changed when the text in them was updated. I now have the buttons working. All I did was redefine the text in the buttons each time after I redefine the text in the fields ="". That ensures that the buttons always have top priority. I set fill alpha to 0 when creating the buttons the first time, so that they would not hide the fields. But that did not affect their touch responses.
Thanks again.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 3:32 pm
by Mr. Kibernetik
If you put buttons on the upper page then you would not need update them anymore - they will always stay on top of fields.
Re: Priority of interface objects
Posted: Thu Mar 24, 2016 3:37 pm
by rbytes
Will give that a try next.
Re: Priority of interface objects
Posted: Sat Apr 02, 2016 9:02 pm
by smabasgil
"I am begining to learn PAGE functionality but i am confused; I have a function which handle dialogs and choices and have decided to place it in a special page. Before, dialogs and choices where lying at the top of the screen, and i thought it would be cleaner, and more logical to proceed with a dedicated page, thus leaving more space for the rest of the interface. The built in doc of SB is quite short about this functionality, and i wonder where i can find more... It seems that when i SHOW a previously HIDEn PAGE, i cannot add interface objets any more.
Re: Priority of interface objects
Posted: Sat Apr 02, 2016 9:28 pm
by Mr. Kibernetik
smabasgil wrote:"I am begining to learn PAGE functionality but i am confused; I have a function which handle dialogs and choices and have decided to place it in a special page. Before, dialogs and choices where lying at the top of the screen, and i thought it would be cleaner, and more logical to proceed with a dedicated page, thus leaving more space for the rest of the interface. The built in doc of SB is quite short about this functionality, and i wonder where i can find more... It seems that when i SHOW a previously HIDEn PAGE, i cannot add interface objets any more.
Please be more specific in what information do you need.