![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Code Samples & Tips Share your recent discoveries and ideas with other users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All,
Is there a 'hotspot' function or control that we can use to execute actions? The hotspot can be a rectangle (better still, any polygon shape or irregular ones).. and this will come useful when there are multiple objects within an area. Instead of having actions script in each objects, a simply hotspot overlaying on top would suffice. If not, perhaps Erel can consider having that in next or future versions... Rgds WZSun |
|
|||
|
Hi Erel,
In Palm, there's what we call gadgets where it's actually a transparent rectangle control/object, where you can have actions. Here's a scenario. Let me see.. ok imagine a 'spot the difference' game where you have a 2 panels, with each panel having an 'almost identical' image. There are 5 areas in the pictures where it's different. HotSpot-A is overlay on top of the whole panel. The smaller HotSpot-1... HotSpot-5 (that surrounds only the region of the different parts' of the image) are placed at the top, above HotSpot-A. When user click on anywhere other than HotSpot-1 to HotSpot-5, they are assumed to have clicked on HotSpot-A instead. An action will be executed.. say, a 'wrong sound effect. If they click correctly on the HotSpot-1 to HotSpot-5, a graphic overlay (circle) will be displayed on top of the picture. With just a single hotspot control, we can reduce unnecessary code in checking for mouse action and x/y coordinates. Hope this to clear the air. For non-games, imagine a 'base panel' with scrollbar. On this panel are say, 10 vertical panels with multiple objects (inage and text) on it.. like a table. Right now, if we click on the vertical panel, nothing will happen. Even if the panel accepts action, it will not work on areas where the image/texts are placed. Then again, this means the images/text must have actions as well. So, instead of the vertical panels, images and text all having similar actions, placing a hotspot on top of the whole vertical panel will execute the action. So, even if user scrolls the 'base panel', the hotspot are still in relative position. Hope that gives you some examples.. of what hotspot can do to enhance Basic4PPC into a better development tool.. and possibly, games development as well. Of course, to further expand on the hotspot, you can even have hotspot with irregular polygon (hmm... for jigsaw puzzle, trigram games) with actions. For other software tools.. the hotspot controls are usually dispayed with dotted 'rubberband' lines. Rgds Ronnie Last edited by WZSun : 04-18-2008 at 12:04 PM. |
|
|||
|
Hi Cableguy,
something like imagemap but not exactly as imagemap would be similar to image button. It's more than just HTML which has its own limitation as well. Let's say... imagine you have an form where you define your own message dialog (to simulate a modal message form). Currently the background 'images' or buttons outside the 'message dialog' are still clickable. Imagine you have a hotspot control surrounding the whole form, but beneath the 'message dialog'. When you display the message, you enable the hotspot... so no matter how user taps on the screen.. only the button in the message dialog is clickable. of course, any request for 'modal form' of any size is another wishlist.. but that is besides the 'hotspot' request... Hope that helps.. |
|
||||
|
The sample you gave, the matching/ discovering diferences in images...
Can be acomplished in the device, although I agree its a very tricky, and code taking job... but its doable with the mouse event's... Then you would have to compare the clicked coordinates with the "stored" or "listed in a file" ones... An hotspot, as you call it, would endeed be a plus, but is something that, as I sayed, can be workrd around, for your "image game"....
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
|
|||
|
Hi Cableguy,
My project is not a game.. the example provided is just for explanation only - one that comes to mind. Many authoring tools provide hotspot controls as standard.. which reduces the need to have identical actions (even using SUBs) on multiple images. Imagine 10 panels with each panel having 5 objects. To enable the objects and panels to be clickable, it means 6 duplicated actions (assuming panel is clickable in the 1st place). Multiply that with 10 panels, you have a total of 60 actions. With hotspot conrols.. you need only 10 controls with 10 actions. A typical hotspot can be a rectangle button with transparency, where it's clickable. An irregular hotspot is just a irregular polygon with transparency. Having transparency means anything beneath the region covered by the hotspot is still visible. I'm fully aware of using codes.. as a matter of fact, I'm using codes currently for a non-game project... no plan to do any game yet as there real applications that would be great with hotspot... although w/o it is still doable.. The wishlist for hotspot is to eliminate unnecessary coding on images/texts etc... leaving the clickable actions on just one single hotspot control.. |
|
||||
|
BTW, you can use one sub event for many controls.
It is done with AddEvent and Sender keywords. You could see more information here: Runtime controls manipulation |
|
||||
|
A simple Hotspot control using an Image control and the Door library takes very little code as long as you are happy with square hotspots. You would have to set up the co-ordinates of the hotspots anyway so the actual code is pretty minimal.
|
|
|||
|
Hi agraham,
Thanks for the sample demo. That is a great one... for rectangle hotspot. Does it work for scrollable panels? Is the coordinates relative to the control, say panel control? Let's say we have a panel, larger than the width. So, there is a horizontal scrollbar. if I specified the coordinates to be x=5, y=5, will it remain the same if the panel is scrolled to the right or left? For example, there are 10 columns, but only 3 are shown at one time on the screen: [1] [2] [3] - normal screen - original position. [2] [3] [4] - scroll to the right when we specify coordinates for column 2, and when user scroll to the right, column2 becomes the first column. If we specify the coordinates for columns (as in original position), when user tap on column3, will it be column2 coordimates, or column3? Rgds WZSun |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| COM controls | lairdre | Questions & Help Needed | 3 | 02-28-2008 08:53 AM |
| Disposing Controls | RandomCoder | Questions & Help Needed | 7 | 02-19-2008 09:26 AM |
| Getting names of controls | BjornF | Questions & Help Needed | 2 | 01-09-2008 02:05 PM |
| Controls name | PepSoft | Questions & Help Needed | 4 | 12-17-2007 02:49 PM |
| Tab Order for Controls | BPak | Questions & Help Needed | 2 | 05-06-2007 05:58 AM |