How activate an objet by a defined area?

http://www.cryo64.us/assets/scenarios/index.html
I'm doing object for my DX themes that I call "Scenarios". The problem that I have is that the icons have a reflection on the floor...so the icon are not squares but tall rectangular images. I would like to define an area where the user can activate the object... and avoid the icons are activated when user go through the reflection.

Is that possible?


Thanks!
7,122 views 14 replies
Reply #1 Top
Screenshot really helps. The simplest way is to create a child object for each icon and set the size to the top icon "defined area". Best to use a mask of the top icon. Basically it acts as an overlay.

For scripting the issue is a little more complex if you've used the normal desktopX settings for mouse over, mouse away, and mouse down.

To do it by script I believe you would have to script all of these states in order to restrict the mouse area. There's a couple ways but, probably the onstate change would be the easiest.

Reply #2 Top
Thank you so much for those tips!!! I'm trying to understand its.. lol. The problem is that I need to do more images for each icon? I mean... if I don't misunderstood you say that I split the images in two parts and make the down part to be child of the top one. Problem is that I spend a lot time doing each one. Could you give me a tip or if you know any tutorial to learn about how do it this by script?

It would be great for to continue doing the icons and only copy/paste the script changing only the target. Is this possible?


THANKS!
Reply #3 Top
You need not to split image in two parts. Just create a new object and set any image for it with dimensions of the area you want to cover for activation. Take this object on top of your icon, set this object opacity 1%, set target of this image as u want for icon, set activation of the icon as "none". Now if you want to change brightness or contrast of the icon on mouse over of the transparent image then use this simple script for your trasparent image.

‘For increasing brightness of icon on mouse over to transparent image
Sub Object_OnMouseEnter
DesktopX.Object("your icon name").Brightness = 10
DesktopX.Object("your icon name").Contrast = 20
End Sub

‘For reseting bightness and contrast on mouse leave
Sub Object_OnMouseLeave
DesktopX.Object("your icon name").Brightness = 0
DesktopX.Object("your icon name").Contrast = 0
End Sub

You can also use the script which inspects mouseposition but it will be a bit difficult.
Reply #4 Top
Easiest way is:
To clone the original object.
Make cloned object a child of first object.
Change the cloned object to the size you want.
Delete the image (appearance tab) from the cloned object.
Set activation in cloned object to visible area only.
In original object rename each state. Eg. mystate1, mystate2
In the cloned object select the messages tab under the states tab.
Click add, select the object ID(original object), under message section type mystate1, etc.

Here's a couple samples I did. One is scripted and the other is same as above.
Box.net
Reply #5 Top
good work again Adam!
Reply #6 Top
Thank you so much guys!!! I will test both ways to see witch one is more easy to make many icons.

Thanks again!!!!!
Reply #7 Top
Woot! SirSmiley always has a solution.    I would prefer the the scripted one, but that's just me.
Reply #8 Top
Awe shucks guys. The credit for the non-script version must go to Mike for pointing those features out to me a while back.

I'm partial to scripting because of the ability to change cursors, etc.

Not to let anyone down here's how I would do multiple icons from one script. Wanted to figure out how to do this for myself.

Scripting Multi-Objects Mouse Over

I'd upload the scripts here but, most of these are examples without any decent graphics. For anyone who cares here's a link to the box.net folder I'm storing these scripts in:
Box.net DesktopX Scripts.
Reply #9 Top
Ok I'm trying with the SirSmiley way but I have some problems because the animation doesn't work. Here is the Link for if you can help me.

My first attempt was with the HAPTORK directions but I think that I'm doing something wrong .

BTW any of you that have great knowledge with ObjectX but lake in graphics skill please I'm open for work together.

Thanks a lot.
Reply #10 Top
This is the problem: The object is composed by two animations... the SirSmiley's method it work but the icon show only a static image. I tryed to modified but with no success.
Free Image Hosting at www.ImageShack.us

The folder on mouse over show a animation (opening the folder)... on mouse away a new animation (folder closing). The think is to do that the activation work only when mouse is over the folder and don't do anything when mouse is over the reflection on the floor.
Reply #11 Top
Ok. This should work.

It took me a bit and gave me a laugh because often the simplest answer is the solution. Your Child Object needs to have Left & Top settings set to 0.

Actually your left should be 32.

Note:
When you drag the child object it will move off of the main object.
If these objects are going to be movable then you need to set up a group for both objects so the child doesn't move off of the first.
If the objects are to be locked in place then just set your main object status to locked and the child object will automatically inherit that.
Reply #12 Top
We are very close SIr and I want to thank you. Yes, you are right about the position (I'm nascent one in this). I fix it but now, if you see, when you make mouse over both animation run making and effect of "open and close" when the idea is that on mouse over the animation should open and stop in the last frame.... then, when the mouse is away run the animation 2 (closing the folder and stop in the last frame that is the same that should be the static icon. I don't know if we need to go back to "mouse away & mouse over" instead "Mystate1 and 2"... (actually I haven't idea why is neccesary rename it.. lol)

THanks!


WWW Link
Reply #13 Top
It works for me. Here's a link to my edited version Box.net.

You need to rename the states to avoid the animation when moving the mouse over the reflection.

If the main object is to be locked in one spot, you could leave the state names unchanged and set the main object status to not active. Then make sure the child object is set to no.
Reply #14 Top
Thank you so much Sir!!! now I think I understand how is the thing. You are master...lol.