Post Reply 
Keeping graphic objects in programs
12-29-2020, 07:00 PM
Post: #28
RE: Keeping graphic objects in programs
(12-27-2020 11:43 PM)Han Wrote:  It may be useful from a programming perspective to create an ordered list of index values. The WAIT command can be used to trap your touchscreen coordinates (bottom of https://www.hpmuseum.org/forum/thread-216.html has a framework that you might find helpful). So for example, if you divide the 320x240 screen into a 10x10 array (each "block" is 32x24 pixels), then the list should be ordered so that the first 10 index values correspond to the first row of blocks, the next 10 index values correspond to the second row, etc. The (x,y) coordinates from the touchscreen can be obtained from the WAIT command, and it should be a simple matter of integer division. Suppose your list is called IndexList. If n = floor(x/32)*10 + floor(y/24), then IndexList(n) should get you the desired index.
Dear Mr. Han,
The first part with the .PNG files went well. As for the second part, I have to tell you that not the whole screen is used for the boxes. This means that there are also unused areas on the screen, which when pressed should actually give an error message in the form of a red circle with an exclamation mark. How much there is unused screen surface depends on the use of this app. This is why it all gets a bit more complicated with the calculation of the index value. With this I hope to have informed you sufficiently for now. Sincerely, Karel.

I use HP-16C, WP-34S emulator, HP-35s, HP-48GX, HP-50g, and HP Prime G2.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Keeping graphic objects in programs - cahlucas - 12-29-2020 07:00 PM



User(s) browsing this thread: 1 Guest(s)